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

dynamic dimension in an agrr function using variable issue

Hi Experts,

 

I'am strungling with a mesure using an agrr function aned a variable as dimension of the agrr 

let's say i have created a variable "vJSM" button with 3 buttons for Day, Week and Month 

and a variable vDimPeriod like this : 

if($(vJSM)=1,
DATE,
if($(vJSM)=2,
[DATE_JOUR.autoCalendar.week],
if($(vJSM)=3,
[DATE_JOUR.autoCalendar.month])))

 

I would like now replace the dimension in this mesure with my variable vDimPeriod : 

So rather than :

sum(aggr( sum( Volume) ,DATE))

or 

sum(aggr( sum(Volume) ,[DATE_JOUR.autoCalendar.week]))

having this : 

sum(aggr( sum(Volume) ,$(vDimPeriode)))

But this mesure does'nt work and i dont understand why ? 

see below 

brunobertels_0-1657271242459.png

 

Thanks in advance for your help 

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master
Author

Hi 

Just in case of same question I fixed my issue using this expression 

I created a new variable vDimPeriode1 =

=pick($(vJSM),'DATE_JOUR','[DATE_JOUR.autoCalendar.SEMAINE]','[DATE_JOUR.autoCalendar.MOIS]')

and add this variable in my final mesure 

sum(aggr( sum(Volume) ,$(vDimPeriode1)))

 

regards 

View solution in original post

1 Reply
brunobertels
Master
Master
Author

Hi 

Just in case of same question I fixed my issue using this expression 

I created a new variable vDimPeriode1 =

=pick($(vJSM),'DATE_JOUR','[DATE_JOUR.autoCalendar.SEMAINE]','[DATE_JOUR.autoCalendar.MOIS]')

and add this variable in my final mesure 

sum(aggr( sum(Volume) ,$(vDimPeriode1)))

 

regards