COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: locus on 11 Nov 2013 06:29:54 AM

Title: Maximum timestamp column on list grouping
Post by: locus on 11 Nov 2013 06:29:54 AM
Hi Folks,

Going round in circles with this, maybe you can help.

I have a list report showing in progress/completed work across three unique sections.
As work is completed in a particular section, the percentage goes up until it reaches 100% (Or null if the section has no work)

Sections is this case are 'FULL/TWR%/MEZZ%'
Timestamp column is 'COMPLETED'

What I need to create is a query that displays the final(maximum) timestamp once all work (all sections) is completed,
and to display nothing until this happens.

As I mentioned occasionally a section can have no work so the approach I have taken is as follows:

CASE WHEN([FULL] IS NULL OR [FULL]= 100)
AND ([TWR %] IS NULL OR [TWR %]= 100)
AND ([MEZZ %] IS NULL OR [MEZZ %]= 100)
THEN(MAXIMUM([COMPLETED]))
ELSE NULL END

While I do get the odd hit that lines up, it is clearly not correct.

Any thoughts??

Cheers,
Locus
Title: Re: Maximum timestamp column on list grouping
Post by: Lynn on 12 Nov 2013 01:03:53 PM
Try flipping it inside out:


maximum
(
  CASE WHEN ([FULL] IS NULL OR [FULL]= 100)
        AND ([TWR %] IS NULL OR [TWR %]= 100)
        AND ([MEZZ %] IS NULL OR [MEZZ %]= 100)
       THEN([COMPLETED])
       ELSE NULL
  END
)