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

[SOLVED] Help with rolling-total

Started by RandomHunter, 20 Dec 2012 02:23:20 AM

Previous topic - Next topic

RandomHunter

Hi all,

I'm working on a report that uses a prompt page with a date selection. The user chooses a period (YYYY-MM) and based on that period, the revenue has to be shown from a year ago until the selected date. I use right(), left() and cast() functions to extract the years/months, but how can I create the YTD'ish function to get the correct revenue.
I hope my problem is stated clear enough.

Here's my solution: I used a case expression to show the revenue when the date is between the selected date minus 12 months and the selected date. Expressions looks like this.

case
when [Date]  between _add_months (_make_timestamp ([SelectedYear],[SelectedMonth],01), -12) and _make_timestamp ([SelectedYear],[SelectedMonth],01)
then [Gross Revenue]