Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone , I am currently trying to change the column used in a aggregate based on a variable.
Here is what I have tried so far :
=AVG( total Aggr( sum(Total), if(Place = 'Country', Country, State) ) )
and
=AVG( total Aggr( sum(Total), if('$(Place)' = 'Country', Country, State) ) )
Where Total, Country and State are columns, and Place a variable.
Note that if I remove the If and use specifically Coutry or State, there is no problem.
I have made sure that the variable has a value.
Is there any way to dynamically specify the dimension in the aggregate function?
We ended up renaming the columns to be the exact name that we used in the variables. Heres what ended up working :
= AVG(total Aggr( sum(Total), [$(Place)] ) )
Not tried but what if you try like this by moving if condition in the Place variable. -
=AVG( total Aggr( sum(Total),'$(Place)'
) )
We ended up renaming the columns to be the exact name that we used in the variables. Heres what ended up working :
= AVG(total Aggr( sum(Total), [$(Place)] ) )