Qlik Community

Qlik Sense App Development

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

prashantsanchet
Contributor

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
Contributor

Re: aggr not wiotking in multiple if states

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)

)

)

)

Community Browser