COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: JoelR on 06 May 2008 11:32:39 AM

Title: Pulling records that have a common sequence
Post by: JoelR on 06 May 2008 11:32:39 AM
How do I pull work orders, using Cognos report studio, that have a status which have been cancelled in a succession/ sequence of 2 or more times?
Title: Re: Pulling records that have a common sequence
Post by: almeids on 06 May 2008 01:59:24 PM
Hmmm...seems we'd have to know a little more about how your data is stored, don'tcha think?
What's the key, what constitutes cancelled, what's the definition of "in sequence"?

Let's guess a record that looks like Date, WO#, Cancel/Uncancel flag and assume in sequence means cumulatively for all time...

Convert cancelled/uncancelled flag into 2 data items: if (cancelled) then (1) else (0) and vice versa.
Sort by date.
Add running totals for your cancelled and uncancelled data items.
Filter on running-total(cancelled)>2 and running-total(uncancelled)>2...you may only need 1 of the data items...you may also want to use an equality test so you only get the work order once.





Title: Re: Pulling records that have a common sequence
Post by: JoelR on 06 May 2008 03:04:19 PM
Thank you, you were very helpful.  I am good to go now.  Sorry about not supplying more information to better help me with a resolution, but your help took me over the edge.