COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: LOUM on 23 Aug 2011 01:34:06 PM

Title: MAXIMUM value assistance
Post by: LOUM on 23 Aug 2011 01:34:06 PM
Hello Again,

I need assistance with my statement below. I have a field in it which is [Last Issue Date], I need the statement to look at that and only calculate off the maximum record as there will be multiple. How should I change this below?


if ([Last Issue Date] is null) then ('10') else

if ([Last Issue Date] between _add_days(current_date,-60) and _add_days(current_date,-31)) then ('30') else

if ([Last Issue Date] between _add_days(current_date,-90) and _add_days(current_date,-61)) then ('60') else ('0')
Title: Re: MAXIMUM value assistance
Post by: LOUM on 24 Aug 2011 07:33:43 AM
The [last date Issued] is pulling by item number if that helps.

Lou
Title: Re: MAXIMUM value assistance
Post by: LOUM on 25 Aug 2011 07:26:52 AM
Bump....anyone? This is really holding me up....      :-\
Title: Re: MAXIMUM value assistance
Post by: MFGF on 25 Aug 2011 08:07:50 AM
You could try replacing [Last Issue Date] with maximum([Last Issue Date] for report) wherever it occurs in your expression. 

This assumes there is just one date for the whole report you are interested in.  If you have multiple rows with different dates within a grouped item, and you want to use the last date for the group, change the expression to be 'for [Your grouped item]' instead of 'for report'

Regards,

MF.
Title: Re: MAXIMUM value assistance
Post by: LOUM on 25 Aug 2011 12:15:39 PM
Worked splendidly M'

Thank you,
Lou

:D :D :D :D :D :D :D
Title: Re: MAXIMUM value assistance
Post by: MFGF on 26 Aug 2011 04:50:46 AM
Great news!  Glad you got it working :-)