1 Reply Latest reply: Feb 9, 2018 5:01 AM by Prashant Sancheti RSS

    aggr not wiotking in multiple if states

    Prashant Sancheti

      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

        • Re: aggr not wiotking in multiple if states
          Prashant Sancheti

          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)

          )

          )

          )