Skip to Content
0

SAP Hana Aggregation at different levels

Jan 25, 2017 at 01:02 AM

68

avatar image

I have a calculation view V1 with multiple measures and multiple attributes( Say Attr1, Attr2, Attr3, Attr4 and Attr5 and date.). Now most of the measures that are already calculated are at Attr1 and Attr2 level. I have one measure for instance M1.

Now I need to join this view to another view say V2 and I need to join on Attr2 and Attr3 .

I need to get a target value from V2 for Attr2 and Attr3 and subtract it from M1.Since they are aggregation at different levels, when I join V1 to V2, the M1 is already grouped by Attr4 and Attr5 and Attr1 and is giving wrong result. I need M1 only aggregated for Attr2 and Attr3.

If I join just considering Attr2 and Attr3 and the measure it works out right. But somehow in this view, I need Attr1 and Attr4 and Attr5 at the end of this view as well, since there are lots of variables based on Attr4 and Attr5.

Has anyone come across this scenario.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Lars Breddemann
Jan 30, 2017 at 10:08 PM
0

Without knowing the specifics of your problem providing and answer is rather difficult.

Generally speaking, whenever you deal with different aggregation levels and you need to compare those (as in join, add, substract ...) you will need some form of normalisation. You will need to bring all the data to the same aggregation level - either by further aggregating the one or disaggregating the other.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Lars. I was able to do a join and aggregate that field.

0