2 Replies Latest reply: Nov 12, 2015 12:10 PM by Sangram Reddy RSS

    compare value

    fabio Mazzarelli

      Hi Community,

      I am confused and need support.

      I need to compare the data for the field Weight moved in the year 2014 with those of 2015 and represent them through kpi going to highlight the difference between the two years .

      I select Year 2015

      Green: current year

      kpi use an expression  ........Sum(TotalWeight) and data are correct.


      Blu: previous year

      When I input 2014 (Blu), kpi use an expression  Sum({$ <vPreviousYear={'$(=vCurrentYear)-1)'}>} TotalWeight)


      sum all data TotalWeight that have PreviousYear = 2014


      but It represents the data of 2015 and NOT 2014.


      What escapes me?

      I'm Immagine.png

        • Re: compare value
          Andy Weir


          Sum({$ <Year={'$(=vCurrentYear)-1)'}>} TotalWeight)


          Not sure why you need to store previous year as a variable where current year is already set.


          To trouble shoot your dashboard

          1. use a kpi to display your variable values and check its being set correctly

          2. try hard coding the years in your formula and getting it working for 2015/2014 then replace with your variables.

          • Re: compare value
            Sangram Reddy

            Hi Fabio,


            Firstly when you are selecting 2015 as you did in the green box, make sure that the blue box does not respond to the selections made by those buttons.


            Once you input value into the input box you can directly use the following expression:

            Sum({$ < year ={ "$(varInputVariable)" } >} TotalWeight )

            Assuming that the variable being updated by the input box is 'varInputVariable'.


            Sangram Reddy.