COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: CalebMF on 28 Aug 2013 04:26:27 PM

Title: Using a count of occurrences in a crosstab
Post by: CalebMF on 28 Aug 2013 04:26:27 PM
I am currently having an issue using a count of occurences in a crosstab.

For example, going along the left axis of the crosstab, I am showing the month that an individual called in.

Then accross the top axis, I would like to show the number of occurrences.

Then as the measure I would like to count the number of individual meeting both criteria.

So for example, there were 10 people who called 5 times in Jan, so there would be a 10 at the intersection of Jan and 5.

What is the formula I would need to right to be able to show the number of occurences? I am sure you will need more data on this, I am just unsure as to what. So please let me know and I will be happy to provide.

Thank you!
Title: Re: Using a count of occurrences in a crosstab
Post by: bdbits on 03 Sep 2013 01:23:34 PM
What we like to do here is add a column to the fact - call it say [occurrence] - defined as a measure with the value 1 on every row. Then in your report, you can use any of the standard functions - sum, count, average, etc. on this measure. We find this comes in handy, if changing the model is an option for you.

If you are stuck with whatever is currently in the model, you should be able to do this with a count(). The exact expression would be a little dependent on your data model.