COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: wwconslt on 15 Feb 2019 05:20:23 PM

Title: Reduce Number of Rows to One
Post by: wwconslt on 15 Feb 2019 05:20:23 PM
Hello,

I'm using a relational model.  This is a list report.  I've created two queries and joined them with a one to many relationship.   

I created several custom data items for each year to look through all previous donations.  If someone donated in 2010 then Y else N, etc.  Because a person can have multiple donation records, I'm getting multiple rows.  But I just want to see one row for one person on the output with Y or N going across.

I'm attaching a screen shot of what I'm getting and what I'd like to achieve.

Thank you.
Title: Re: Reduce Number of Rows to One
Post by: Cognos_Jan2017 on 15 Feb 2019 09:33:28 PM
My tablet would not open your attachment.

Try a query to aggregate the desired measure Total.
Title: Re: Reduce Number of Rows to One
Post by: Boksberger on 16 Feb 2019 11:55:27 AM
A simple way is to use max() on yearly data item value partitioned by year.
Title: Re: Reduce Number of Rows to One
Post by: wwconslt on 16 Feb 2019 12:00:52 PM
Thank you for your responses.

Can I use max on a Y/N data item?

I changed each FY custom data item to return a 1 or 0, then changed aggregation to total for each.  Then I created a layout calculation to display either a Y or N across the row.  Time consuming but it's working.

Title: Re: Reduce Number of Rows to One
Post by: wwconslt on 16 Feb 2019 05:13:45 PM
Boksberger, I tried the max function on each FY data items.  And it worked!  Thank you.