7 Replies Latest reply: Oct 25, 2013 2:57 AM by jagan mohan rao appala RSS

    Action buttons on two variables

    Anna Perini

      Hi, i'm facing this problem: i've a bar graph where i'm showing





      My customer is asking me to have an action button for switching from sum to avg. No problem i've created a variable vAggr to do it

      if(vAggr='sum', sum(sales), if(vAggr='avg', avg(sales))

      Then he asked me to cycle on time dimension not with a classic QV symbol but he wants further buttons to set Year, Month,ecc

      I tried with a further variable vTime but when i try to use it, it stops calculating avg. I use this expression:

      if(vAggr='sum', sum(sales), if(vAggr='avg', sum(sales)/count (distinct $(vTime)))

      Where is the problem, i can't see it. Tks