on 11-14-2013 2:48 PM
Hi All,
I need help in achieving Percent_Rank() function in CE scripted calculation view. When I run this code in SQL console, it works. When I use the same in CE_CALC, I end up with syntax error. Below mentioned are the code snippets I used in SQL console and Calc View.
In SQL Console
SELECT PERCENT_RANK() OVER (ORDER BY "FIELD") FROM "SCHEMA"."TABLE";
This returns me the results. Similarly in calc view, I tried
BEGIN
OP1 = CE_COLUMN_TABLE ("ECC"."MARA");
var_out = CE_PROJECTION(:OP1,["MATERIAL",
CE_CALC('PERCENT_RANK() OVER(ORDER BY "MATERIAL")',DECIMAL(10,2)) AS MAT_RANK ] );
END;
Any ideas on this..??
Regards,
Chandu.
You can't do PERCENT_RANK() in CE_CALC. Instead you do this:
In SQL Console
SELECT PERCENT_RANK() OVER (ORDER BY "FIELD") FROM "SCHEMA"."TABLE";
This returns me the results. Similarly in calc view, I tried
BEGIN
OP1 = CE_COLUMN_TABLE ("ECC"."MARA");
var_temp = CE_PROJECTION(:OP1,["MATERIAL", "RANK_COLUMN");
var_out = SELECT PERCENT_RANK(RANK_COLUMN) OVER (ORDER BY "FIELD") AS MAT_RANK FROM :var_temp;
END;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandu,
I don't think that the window function like PERCENT_RANK() is supported in CE_CALC function.
You can check the F1 help in HANA Studio for CE_CALC and can check the supported functions.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.