COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: tibo-k3 on 31 May 2011 07:18:43 AM

Title: Tuples and date ranges
Post by: tibo-k3 on 31 May 2011 07:18:43 AM
Hi,

I'd like to compare a measure for two differents date ranges. These range has to be defined by the user, as data parameters : range1_start, range1_end, range2_start and range2_end (so, the length of the range is not defined and no necessary the same).

In my X table, i put the measure and I'd like to have tow columns as calculated members :

tuple( [time].[date] -> in_range (range1_start , range1_end) )

Obviously it doesn't work... I works only for "-> range1_start" or "-> range1_end" but not for something like "between", "range" or ">= and <="...

Anyone ? Thanks !
Title: Re: Tuples and date ranges
Post by: tibo-k3 on 01 Jun 2011 11:21:51 AM
Okay... So, i finally used something completly different, using expression :

total(
case when
[dimension].[hierarchy].[date] >= ?date1?
and
[dimension].[hierarchy].[date] <= ?date2?
then
[mesure]
else
0
end)
Title: Re: Tuples and date ranges
Post by: technomorph on 02 Jun 2011 04:31:51 AM
If I understand correctly it sounds like you might be using two date prompts to create a range? If this is the case, you don't need to do this. Just set the Range property to true on the date prompt and I reckon something like the following will work (although as a disclaimer, I haven't looked at MDX for a while):

tuple( [time].[date] -> in_range ?date?, measure )

Cheers