Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
kohesco
Active Contributor


Hi,

I'm seeing a lot of messages where people ask the question to get the max dimension, so they can aggregate the table.

Example:

database

CountryCategoryMaterialQuantity
FranceAMatD35
FranceAMatE25
GermanyAMatA80
ItalyBMatC75
SwedenCMatE10

desired output

CountryCategoryMaterialQuantity
FranceAMatD60
GermanyAMatA80
ItalyBMatC75
SwedenCMatE10

Quantity is set as sum and for material we display the Material with the highest quantity.

If you use: a variable set as measure and formula: max([material], you will get the wrong result, because he is not looking at the quantity (webi is not that smart).  this results in MatE.

The solution:

  • Create variable (measure): max =Max([Quantity] ForEach([Material];[Category];[Country]))

With this formula we get the max value over Material

  • Create variable (measure): mat_max =Max([Material] Where([Quantity]=[max] ForAll([Material])))

With this formula we retrieve the Material with the max value regardless "material", so for us it means we retrieve MatE because the max over material for france is 35

So we see he filters out the Materialgroup in mat_max, only the material with max value is selected, otherwise is set to blank.

If we set the formula ([Material] Where([Quantity]=[max] ForAll([Material]))) to max, it will show only the material that is not blank, check out document:

Aggregated Dimension

  • Result:

Check Double Check

2 Comments
Labels in this area