COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: esanray on 05 Apr 2011 09:12:02 PM

Title: count the following query
Post by: esanray on 05 Apr 2011 09:12:02 PM

My database contain following types of data

Reason        airlines        Date
Delay      Air India   04/04/2011
Cancel      polynasia   05/04/2011
Delay      Singapur   05/04/2011
Delay      Air India   05/04/2011
Cancel      polynasia   05/04/2011
Delay       Singapur   06/04/2011



I want to know how to count the delay & cancel reason airline wise. In frame work manager level or report studio level. so that I can create the following type of report

Operation Date. 05/04/2011           
Flights   Air India   Poly    Singapur
Delay   1   0   1
Cancel   0   2   0


Title: Re: count the following query
Post by: mrcool on 05 Apr 2011 09:33:16 PM
Select count(reason),Airlines,date from table1 group by Airlines,date

Create a dataitem with following expression count(reason)
Title: Re: count the following query
Post by: esanray on 05 Apr 2011 11:39:01 PM
is it possibule in FM
Title: Re: count the following query
Post by: mrcool on 05 Apr 2011 11:52:56 PM
Yes why not.create a queryitem in the model querysubject with this calculation.
Title: Re: count the following query
Post by: esanray on 06 Apr 2011 02:47:04 AM
thanks its work
Title: Re: count the following query
Post by: esanray on 06 Apr 2011 02:56:46 AM

I want to filter  Air India   &  singapur

I write query like column name  ('Air India'   'singapur' )but it  give some error. Can you please tell me the write syntax.
Title: Re: count the following query
Post by: PRIT AMRIT on 06 Apr 2011 03:00:00 AM
It should be: [Column Name] in ('Air India' , 'singapur' )
Title: Re: count the following query
Post by: esanray on 06 Apr 2011 03:30:26 AM
thanks a lot, its working