Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 845

Use Conditional Statement If Else / Case When in Odata , xsodata code

$
0
0

Hi Friends,

 

Kindly enlighten me on the following query which though seems simple but I am not able to handle using the UI5 code which consumes the odata.

 

How do I create the following conditional statements in ODATA considering the below the given sample code.

 

  1. create if else / case when  on column acting as Dimension

for example: ("MONTH_NAME")

 

  1. create if else/case when  on column acting as Measure

for example: SUM of "TOTAL_WORKING_IN_HOURS"

 

service

{

"_SYS_BIC"."ASL_PK/TEMP_SCALC_HEALTH" as "TEMP_SCALC_HEALTH_V3"

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");

}

 

Thanks for your help.


Viewing all articles
Browse latest Browse all 845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>