Skip to Content

SAP Hana Aggregation at different levels

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 30, 2017 at 10:08 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded