COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: slipperyfin1 on 28 Oct 2019 11:46:18 AM

Title: Total into one row if a field is duplicated
Post by: slipperyfin1 on 28 Oct 2019 11:46:18 AM
I've had a hard time figuring out how to word this, so it's best if I visualize it.

Here is what I have:

NAME        # of Apples         # Hours Worked
Mike               8                            1
John               3                            1
John               4                            1
Steve              5                           1
Mary               7                           1

Here is what I want:

NAME        # of Apples         # Hours Worked
Mike               8                            1
John               7                            2
Steve              5                           1
Mary               7                           1

John has two separate entries, but I only want one entry to appear and I want it to be the total of the two.

This is for a list report. Any help is greatly appreciated.
Title: Re: Total into one row if a field is duplicated
Post by: adam_mc on 28 Oct 2019 12:04:28 PM
Assuming that both # of Apples and # Hours Worked are defined as measure and as numerical, you should just need to set the Aggregation property of both data items to be Totals.
Then, Cognos will automatically roll-up to the lowest level of detail you are showing.

Hope this helps.
Thanks,
Adam.
Title: Re: Total into one row if a field is duplicated
Post by: dougp on 28 Oct 2019 12:13:42 PM
Is this in a package or an uploaded spreadsheet?

If this is a spreadsheet, "Update file" and make those columns measures.

If this is in a package, talk to your admin about making those columns measures and applying a default aggregation method in the model.
Title: Re: Total into one row if a field is duplicated
Post by: Francis aka khayman on 28 Oct 2019 12:27:35 PM
most probably you are using a dimensional model. there are two entries with caption = 'John' with different ids. that is the reason why you see two Johns.

check this entry in my blog it may help:

http://cognosm.blogspot.com/2015/12/stripping-dimensionality-of-memeber.html

Title: Re: Total into one row if a field is duplicated
Post by: Andrei I on 23 Dec 2019 01:32:08 PM
Quote from: slipperyfin1 on 28 Oct 2019 11:46:18 AM
I've had a hard time figuring out how to word this, so it's best if I visualize it.

John has two separate entries, but I only want one entry to appear and I want it to be the total of the two.

This is for a list report. Any help is greatly appreciated.

Please specify what datasource you are using (Dimensional, Relational, the more details the better)
Title: Re: Total into one row if a field is duplicated
Post by: Francis aka khayman on 30 Dec 2019 09:25:30 AM
also check the # of apples and # hours worked column. make sure they are treated as numbers and set detail and summary aggregation to "total".

check as well the query make sure property auto summarized = yes