Hi
I have this scenario where I need the counts ( like fleet count or headcount) not to aggregate when rolled to a upper level
for example : The counts are now at the lowest granularity of months
but when I remove months , the counts roll up ( which is incorrect )
The logic I need is If I roll up from months to quarter , I need the counts of the max month within the quarter
[Q1 = apr, may, jun and q2 = july , aug, sep ...]
so Q1 should have the count of June ( max month of q1)
and Q2 should have the count of the max month ( max month of data present in Q2)
so the correct result is like this ( but this approach leads to a proliferation of named measures , so not acceptable )
the current period count or Q1 etc counts have been done by using a scripted view with logic
CASE WHEN PERIOD = (SELECT MAX(PERIOD) FROM "FLEET"."FLEET_COUNT" WHERE
QUARTER = 'Q1' AND FISCAL_YEAR = (SELECT MAX(FISCAL_YEAR) FROM "FLEET"."FLEET_COUNT" ))
THEN SUM(FLEET_COUNT) ELSE 0 END AS Q1_COUNT
What is a better way to do it in HANA. Head Count or fleet counts is a common BI / KPI scenario . I been looking at blogs/comments by Ravindra Channe / Jody Hesch for exception Aggregation or group by sets , but could not find a solution yet..
Would be super super super grateful for guidance !!!
Rishi