Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
elijahabel
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
6/3/2018AA150
6/4/2018AA160
6/5/2018AA110
6/4/2018AA2-30
6/5/2018AA230

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
sunny_talwar

Try this

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

elijahabel
Contributor III
Contributor III
Author

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