COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: alex_ on 15 Oct 2012 09:51:29 AM

Title: Count Measure rows in crosstab?
Post by: alex_ on 15 Oct 2012 09:51:29 AM
Hi,

In singleton I put data item which I want to count Measure rows in crosstab.
When I use the function: count([Quantity] for report)
Result gives me a different value from that which should give.

Where do you think I'm wrong?
Is there another way to count the rows in crosstab?

Thanks.

Title: Re: Count Measure rows in crosstab?
Post by: Greg on 15 Oct 2012 11:07:24 AM
I would guess that your crosstab is at an aggregate level that shows 7 rows but that there are 48 detail rows that contribute to this aggregate level which is what your expression is counting.

Try doing a count distinct on one of the items in the crosstab that isn't being aggregated and is unique across all 7 rows.
Title: Re: Count Measure rows in crosstab?
Post by: alex_ on 15 Oct 2012 12:42:52 PM
Thanks for the advice, Greg.

I changed the function of 'count(distinct [Detail Target]for report)' , but the result is still incorrect (14)

I will mention that in Properties pane is set in the following manner ->Aggregate Function is 'Count' and Rollup Aggregate Function is 'Automatic'.

Thanks.
Title: Re: Count Measure rows in crosstab?
Post by: Greg on 15 Oct 2012 03:25:40 PM
It looks to me like Detail Target is a measure that is being aggregated.

Try creating a new data item in your query that concatenates Account and Out of Target Metrics.  This should provide you with an item that is not aggregated and is unique within the rows of your crosstab.  Then do a count distinct on that item.