Cognos Analytics

 View Only

Last year Sales based on current year

  • 1.  Last year Sales based on current year

    Posted 7 hours ago

    Hi,

    I have a report where the sales data is displayed based on the period selected via the prompt page. I would like to add a new column, "Sales (Last Year)," which will display the sales for the same month in the previous year, relative to the period entered in the prompt.

    For example, if the user enters the period as 202502, the "Sales (Last Year)" column will show sales for the period 202412. Similarly, if the user enters 202404 as the current period, the "Sales (Last Year)" column will display sales for the period 202312.

    my current expression is for calculating the sales is

    tOTAL(IF(  [Period Num]= ?Period? and [Country] = 'USA') THEN (Sales) ELSE (0)) 

    Could you please modify this expression for last year last month period?

    Thanks in advance.



    ------------------------------
    Max Ray
    ------------------------------