Being on an old version of SAP HANA Studio (rev 48) as compared to the server (rev 51), I was not able to access a calculated column from an analytical view in the calculation view SQL script. You also should check the definition of the Analytical view in _SYS_BIC, if it actually has the column (even if it shows it in data preview it might be missing in the definition).
Update to match the server version or higher (I updated to revision 52), reactivate the analytical view and it should show the calculated column in it’s defintion:
Notice I am choosing “dsproten/SHOP_FACTS” and not “dsproten/SHOP_FACTS/olap” (which shows the same Orange Cube icon). If you can find it ending in “/olap”, you are probably on an older SAP HANA Studio version.
For example:
This shows my calculated column "QPLUAM":
If the column is not listed, the SQLscript in a calculation view will also not see the Calculated column and throw an error.
After adding a new calculated measure in the analytical view, select “Semantics”. In this example QPLUAM. Aggregation type is set to “NONE” by default.
When activating it does go through, but with a warning on validation:
Change the aggregation type to FORMULA and the warning will disappear.
And you can proceed to retrieve the value in a Calculation view:
var_out = CE_OLAP_VIEW("_SYS_BIC"."dsproten/SHOP_FACTS",["STATE","CATEGORY",SUM("MARGIN"),SUM("QPLUAM")]);
Tip: don’t forget the output is definied at 2 levels, add your Output parameter fields created in the script definition also to the output of the calculation view.
Data Preview et voilà!