COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: asmfloyd on 23 May 2023 10:19:31 PM

Title: Doing aggregation for a column
Post by: asmfloyd on 23 May 2023 10:19:31 PM
Hi,
  I am trying to de-normalize data. I have 4 columns in a report Fundname, Sharename a 2022sharevalue and 2023sharevalue.
     In 2022share value, I am coding as IF (Year=2022) then (sharevalue) else (0). Same logic for 2023 with year=2023. I set the detail aggregation property to "Maximum" for both columns.

When I run, instead of one single row, I am getting both rows. Is there anything else which I need to do so that it gives result as A,B,33,25
Currently:
   A,B,0,25
   A,B,33,0
Title: Re: Doing aggregation for a column
Post by: MFGF on 24 May 2023 07:18:13 AM
Quote from: asmfloyd on 23 May 2023 10:19:31 PM
Hi,
  I am trying to de-normalize data. I have 4 columns in a report Fundname, Sharename a 2022sharevalue and 2023sharevalue.
     In 2022share value, I am coding as IF (Year=2022) then (sharevalue) else (0). Same logic for 2023 with year=2023. I set the detail aggregation property to "Maximum" for both columns.

When I run, instead of one single row, I am getting both rows. Is there anything else which I need to do so that it gives result as A,B,33,25
Currently:
   A,B,0,25
   A,B,33,0

Hi,

Assuming you are using a relational model, this sounds like exactly the right thing to do in order to get the result you are looking for. This means something else must be going on in the report.

One thing to check is in the properties of the query feeding your list. Make sure the "Auto group & summarize" property is enabled.

What else is happening in the report? As a sanity check, try building a new report with just these four items in it, and see if it works?

Cheers!

MF.
Title: Re: Doing aggregation for a column
Post by: asmfloyd on 01 Jun 2023 07:26:11 AM
Thank you @MFGF for the reply. I had to apply a maximum() on each column to get this rolling.

Regards,
Title: Re: Doing aggregation for a column
Post by: MFGF on 01 Jun 2023 10:01:11 AM
Quote from: asmfloyd on 01 Jun 2023 07:26:11 AM
Thank you @MFGF for the reply. I had to apply a maximum() on each column to get this rolling.

Regards,

Hi,

Yes, this is required. Didn't you say you were already doing this in your initial post?

Quote from: asmfloyd on 23 May 2023 10:19:31 PM
I set the detail aggregation property to "Maximum" for both columns.

Cheers!

MF.