Skip to main content
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Using GetObjectDimension in Aggr

     Is there a known way of using GetObjectDimension within Aggr? Let's say I have the following data:

DateDivisionDepartmentDaily Profit

If I use this data in a 2d Pivot table and I want to add a std deviation function that is dynamic based on the orderings of the Dimensions and how many levels are open, is there any way I can use the above function?

Example of what I am trying: stdev(aggr(Sum([Daily Profit]),GetObjectDimension(Dimensionality()-1),Date))

The result of the above is '-' all the way down no matter what dimensions are exposed. Any way i can adapt this without using if statements? I think Qlik is just not parsing the GetObjectDimension(Dimensionality()-1) correctly for some reason, even though I have confirmed that this expressions gives me what I desire by dropping it into my table.

I know that you can do nested if statements, but if the number of dimensions I have in my 2d pivot table is more than 2, then the nested if statements become unwieldy and complicated.

Thank you in advance!

2 Replies

Try this

Stdev(Aggr(Sum([Daily Profit]), $(='[' & GetObjectDimension(Dimensionality()-1) & ']'), Date))

Contributor III
Contributor III

Hmm, this did not work either. Still getting '-' everywhere.