Question

Cognos by default suppress duplicate/identical records. Duplicate rows do not appear in the report, but summaries are performed on all rows - including the duplicates that were eliminated.

To perform summaries on only the distinct rows, you must add the distinct key word when creating the summary definition. For example, the following summary:

Total(MyColumn)

Would become...

Total (distinct MyColumn)

But I would like Total of Column1 based on Distinct values of Column2. How to do this?

Was it helpful?

Solution

I assume your report is built on top of relational model. The short answer to your questions is using FOR clause:
Using the AT and FOR Options with Relational Summary Functions

So you can do something like this:

Total(distinct MyColumn for Column2)

My question is why would you think distinct on one column is different from other column?
Cognos "eliminate" duplicate rows only if two or more rows are completely identical.
If one of the columns is different, then it's not a distinct row.
You can use grouping instead, which group together identical values on single column.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top