COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: LOUM on 09 Nov 2011 01:11:11 PM

Title: CROSSTAB Date frame assistance
Post by: LOUM on 09 Nov 2011 01:11:11 PM
Good Day Everyone,

I am trying to write a data item in my query that basically takes the date of the transaction and then sums my totals.

Between date 1 and date 2 sum (qty)  "This equals 3 months usage."
Betweeen date 3 and 4   sum (qty)       "This equals 3 to 6 month usage"
Betweeen date 5 and 6   sum (qty)        "6 to 9 month usage"

Any ideas?
Title: Re: CROSSTAB Date frame assistance
Post by: pricter on 15 Nov 2011 09:21:49 AM
Try the following
Create the following data items one for each period you want

if (date between 1 and 2) then (your measure) else 0 "This equals 3 months usage."
if (date between 3 and 4) then (your measure) else 0 "This equals 3 to 6 month usage"
if (date between 5 and 6) then (your measure) else 0       "6 to 9 month usage" "6 to 9 month usage"

PS: Remember that there is the month function that returns the month of a date