1 Reply Latest reply: Jun 16, 2010 4:09 AM by umangu2000 RSS

    [ASK] how to compare current year with last year ?

    kribo.alim

      hello..

      i have fields : year, sales_total, product_total

      and first i made a table like this :

      error loading image

       

      i'm trying to compare current year Sales Revenue with previous year Sales Revenue with a chart

      first try i use city as a dimension, and expressions : current year -> if(Year,sum(Sales)) , previous year -> if(Year-1,sum(Sales))

      and the result is :

      error loading image

      the previous year still show the current year result

       

      is there anyone able to help?

       

      btw i load data from XLS files..

       

      many thx...

      :)

       

        • [ASK] how to compare current year with last year ?

          if you want to be able to do it only for the Current year ie 2005 and the previous year ie 2004 it's quite easyand there will be no need to select and fields.

          Current year = sum ( if ( Year = Max(Year) , Sales,))

          Previous Year = sum ( if ( Year = (Max (Year)-1, Sales, ))

           

          In case you want to do it for 2004 & 2003 you will have to deselect all years after 2004