IBM Business Analytics

 View Only

Selected Period and Last Year Last Month

  • 1.  Selected Period and Last Year Last Month

    Posted Wed February 26, 2025 06:29 AM

    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
    ------------------------------