COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: hrjanardhan on 02 May 2016 03:33:26 AM

Title: [ANSWERED] How to count number of occurrences for each value in a column
Post by: hrjanardhan on 02 May 2016 03:33:26 AM
I am using Cognos BI 10.2.2 I have developed a report to display the following

Order No | Country | Quantity |
1                US           3               
2                UK           2               
3                Brazil       5               
4                UK           1               
5                US           2               
6                UK           6

Now I want to know how can I have the following (Preferably at the header level)

No of Orders in US            2
No of Orders in UK            3
No of Orders in Brazil        1

Also remember, the value for Country is coming selected from the prompt. So the above summary should be generated dynamically based on the choice made in the prompt.
Title: Re: How to count number of occurrences for each value in a column
Post by: HalfBloodPrince on 02 May 2016 07:09:38 AM
count ( order no for Country)
Title: Re: How to count number of occurrences for each value in a column
Post by: venkat01 on 02 May 2016 07:14:34 AM
create a dataitem in the list query with an expression as count([order no] for [country]) and create a list page header for the list then drag this dataitem into it as a singlton it will be placed there then drag a text item to write No of Orders in space then drag [country] dataitem then this created dataitem.
Title: Re: [ANSWERED] How to count number of occurrences for each value in a column
Post by: hrjanardhan on 03 May 2016 01:36:28 AM
Thanks guys.

I made use of count([Order No] for [Country]). I made a list the header level.