COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: rkas on 27 May 2021 03:55:54 PM

Title: Adding total value from two lists in one field
Post by: rkas on 27 May 2021 03:55:54 PM
Hi,

I have two lists on my report. Each list has total value. Each list has his own query
I'd like to sum total values from theses two lists and put in one additional field.
How can I do it ?

Regards,
Rafal
Title: Re: Adding total value from two lists in one field
Post by: dougp on 27 May 2021 04:05:37 PM
I assume what you mean by "one additional field" is a singleton somewhere on the page, outside of both lists.

simple brute force:

query1:
dimension1
dimension2
sum of measure1

query2:
dimension3
sum of measure2

query3:
sum of [query1].[measure1]

query4:
sum of [query2].[measure2]

query5:
sum of [query3 union all query4].[measure]
Title: Re: Adding total value from two lists in one field
Post by: rkas on 29 May 2021 01:02:39 PM
I mean that field outside of both lists.
I try to put this field into table and use query calculation but the system does not allow to use two different query for one field.
I must admit that your answer is not clear for me.