9 Replies Latest reply: Jan 26, 2012 3:40 PM by Martin Goebbels RSS

    Compare the month in This year vs. same month in last year

    Martin Goebbels

      Hi,

       

      i'm just learning, so excuse me if my question is somehow naif.

       

      I have a table with orders (order_ID, order_date , order_value) and want to build a graph containing the monthsname(order_date) as dimension an two expressions of kind sum(order_value) :

      expr1 : sum of the order_value for the month given

      expr2 : sum of the order_value for the  same month but of the year before.

       

      Example:

      Data:

      Id           Date            Value        monthname(Date)

      232323   4/15/2003     150.0        'apr 2003'

      324455   4/05/2004     200.0        'apr 2004'

       

      expr1 : Sum Order _Value for 'apr 2004' = 200

      expr2 : Sum Order_Value for 'apr 2003' = 150

       

      Final set  (for Graph)

      monthname               expr1      expr2

      'apr 2003'                   150           -           

      'apr 2004'                   200        150