If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Last Quarter in Report Studio

Started by StelaK, 08 Nov 2010 03:15:10 PM

Previous topic - Next topic

StelaK

Been trying all day and cannot get the correct expression definition to show last quarter vs current quarter for transaction date in RS.

Somebody could advice?

Thanks a lot!!!

cognostechie

Can you be more specific as to what you are trying to achieve?

If you need columns to show values for Current Quarter, Last Quarter and the difference between them, this is what you can do:

Let's presume your measure is Sales

1> Create a calculation to determine the Current Quarter, let's say ..CQtr
2> Create another calculation to determine the Quarter of the Transaction Date, let's say TQtr

-- The expression for both of the above depends on whether you are following calendar months or fiscal months. For calendar months:

  If extract(month,Transaction Date) in (1,2,3) then (1)
else If blah blah blah
else (4)

For the 1st one, replace Transaction Date with 'current_date'

3> Create a calculation like - If (TQtr = CQtr) then (Sales) else (0) 
        --- This will give you the Current Quarter Sales
4> Create a calculation like - If (TQtr = CQtr - 1) then (Sales) else (0)
        --- This will give you the Sales of Last Quarter
5> Difference between the above two will give you the difference in Sales (Current Qtr vs Last Quarter)

When your Current Quarter becomes 1 then it will fail so you will have to check for the year too.


I am not a RS expert so hope somebody would come up with a better solution..

Ideally these columns are created in Framework Manager but in a more dynamic way for relative time categories.