COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: rlcaputo on 16 Jan 2006 05:13:47 PM

Title: Count Items in Column with Totals
Post by: rlcaputo on 16 Jan 2006 05:13:47 PM
I have two columns in a list table. Each has ones and zeros in it. (simplify things) I create a crosstab with fiscal week across top and a unique number in the rows. The rows get grouped by this unique number. (There are many of one in the list table)

I can get the count, of 1 in the measure area of crosstab, where each fiscal week has a unique number. I cannot get the blasted thing to total at the bottom. I get zeros.

What am I missing, this can't be that hard.

Thanks in advance,

???
Title: Re: Count Items in Column with Totals
Post by: BIsrik on 17 Jan 2006 03:36:58 AM
Sorry..I couldnot get ur reqd..i feel u r looking for the total and grand totals in the cross tab. If that is the case..select on the measure field and click the aggregation icon in the toolbar.

Srik
Title: Re: Count Items in Column with Totals
Post by: rlcaputo on 17 Jan 2006 09:23:45 AM
The column is using "count non-zero" so I get 1 or 0 in the rows. When I try to do a total, it changes from 1 or 0 to actual sum and then gives totals. I just want to count 1's.

Its tough to explain. I am counting instances of an item, not quantity.
Title: Re: Count Items in Column with Totals
Post by: bdybldr on 17 Jan 2006 04:28:13 PM
Instead of using "count non-zero", why don't you use "count(distinct([field1]))" in the definition of your field.

You could also use something like: IF field1 = 1 THEN 1 ELSE 0.  Then set the aggregate for total (field1).

This is difficult to advise without completely understanding your requirements.  Can you provide more info?

What is the field that you're counting non-zeros on?  How is that field defined?
Title: Re: Count Items in Column with Totals
Post by: CoginAustin on 18 Jan 2006 01:22:14 PM
If you just want a count of  1's cant you just sum it?