Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

elijahabel
New 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
MVP
MVP

Re: Using GetObjectDimension in Aggr

Try this

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

elijahabel
New Contributor III

Re: Using GetObjectDimension in Aggr

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

Community Browser