Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
prashantsanchet
Creator
Creator

aggr not wiotking in multiple if states

Hi team,

I have bar chart and i want to chnage the values of dimention based on user selction.

I have variable which will have the value which user will select. I am trying to use following as dimention :

if(

     vSelector='Customer', aggr(if( (sum(revenue)0)    ,[CustomeDescription]),[CustomerDescription]) ,

     if(vSelector='Industry',

                    aggr(if( (sum(revenue)0)    ,[IndustryDescription]),[Industry]) ,

     if(vSelector='Region',

               aggr(if( (sum(revenue)0)    ,region),region

) ) ) )

But this is not working as expetced . the values before adding in if else statement are different than after we will use this expression


i have measure sum(sales) which value will be calculated based on other period selector like "MTD" ,"YTD

1 Reply
prashantsanchet
Creator
Creator
Author

The expression is like this not as above:

if( vSelector='Customer',

aggr(if(

(sum(revenue)<=0) or (sum([revenue])>0)     ,[CustomeDescription]),[CustomerDescription]),


if(vSelector='Industry',

aggr(if(

(sum(revenue)<=0) or (sum([revenue])>0)     ,[IndustryDescription]),[Industry])

,if(vSelector='Region',

aggr(if(

(sum(revenue)<=0) or (sum([revenue])>0)     ,region),region)

)

)

)