2 Replies Latest reply: Oct 27, 2016 12:45 PM by federico casarotto RSS

    Set Analysis to calculate last day of previous month.

    Giuseppe De Vivo

      Hi all,

      I show you a table with 2 columns: Date and one Misure.

      example1.png

      The column Date contains dates in this format "DD/MM/YYY" and the column "Misure X" the corrispondent value of each day.

      I need to calculate this formula:

      ((Value Y - Value X) / Value X) * 100

      as it is shown in the picture.

      Value X is the value of the last day of the previous month of the month selected by the user.

      Value Y is the value of each day of the selected month by the user.

      I need to calculate the formula for each day of the selected month by the user, divi

      For example:

      - Value X = 49,892 (corrispondent value of the last day of the previous month of the month selected by the user)

      01/04/2015 ---> ((49,921/49,892)/49,892) * 100

      02/04/2015 ---> ((49,909/49,892)/49,892) * 100

      07/04/2015 ---> ((50,075/49,892)/49,892) * 100

      ...etc...

       

      I tried to calculate the last day of the previous month with this expression

      date(max(addmonths (mydate,-1,1)))
      

      And it works.

       

      I tried to calculate the corrispondent value of this date, but I have a problem to formulate a SetAnalysis expression to calculate the entire formula.

       

      Can someone help me, please?

       

      Thank you.