4 Replies Latest reply: Mar 20, 2013 10:22 AM by Markus Führer RSS

    Comparison Month <-> previous month

      Hi all,

       

      I tried to find a solution within the community group here but didn't find any solution which works for me.

      I have a table like following:

       

      MyDate           Value     Type

      01.10.2012     10.000     Car

      01.10.2012         500     Bike

      01.11.2012     12.000     Car

      01.11.2012       1.200     Mini

      01.11.2012          600     Bike

       

      I want to have a straight table with date in the Dimension MyDate and the expressions value, prev.month and Difference in the lines.

       

                               Oct 2012          Nov 2012      ....

      Value                   10.500               13.800     .....

      prev.Month               0                   10.500     ....

      Difference            10.500                 3.800     .....

       

      I created a new Variable vMonthMinus1 like this: =date(addmonths(MyDate,-1),'YYYY-MM')

       

      In my expression I tried to have the following:

      =sum({<MyDate=vMonthMinus1>}[Value])

       

      Unfortunetly I got only 0 as result. Can someone help me ?

       

      Many thanks in advance from germany

      Markus