Skip to Content
0
Former Member
May 13, 2016 at 07:53 AM

Creating computed columns / computed measures in odata code for UI5 consumption

236 Views

Hi friends,

We are creating odata for UI5 consumption

We are able to create measures and dimensions(for reports) using aggregation functions in odata using the following code.

service

{

"_SYS_BIC"."ASL_PK/TEMP_SCALC_HEALTH" as "ALIAS_ABC"

with ("MONTH_NAME","TEMP_DIV","TOTAL_WORKING_IN_HOURS","EM_WORKING_IN_HOURS")

keys generate local "ID"

aggregates always (SUM of "TOTAL_WORKING_IN_HOURS",SUM of "EM_WORKING_IN_HOURS");

}

Our requirement is to create COMPUTED COLUMNS(COMPUTED MEASURES) to be consumed in reports dynamically(selecting any Dimension(s)

How is it possible to create the same in odata code eg.( SUM of "COL A"/SUM of "COL B" ) or ( SUM of "COL A"/SUM of "COL B" )*100

Also how to use arithmetic operators (+,-,*,/) on the measure column in odata code.

FYI:

1>If the computed column in created in the VIEW level we still have to being it in the odata code as a dimenion or measure which does not give the correct values when it is selected with different dimension combinations

2>We are can't do even the simplest mathamatical operations eg. COL_A/COL_B in the ODataURL.

Kindly help us this issue as we need the computed measures in numerous reports.

Thanks,

Prateek A