COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: axxo on 26 Mar 2009 07:13:38 PM

Title: adding 2 tuples
Post by: axxo on 26 Mar 2009 07:13:38 PM
How can I add 2 tuples together?

Crosstab is divided into 3 nested nodes at top and 3 nested nodes at the bottom.

There are 2 rows right at the very bottom in the crosstab not within any of those nodes.
data item 1 has expression tuple([Total(CC11)]) (displays correct data)
data item 2 has expression tuple([CC75]) (displays correct data)

I want to add
data item 3 which adds data item 1 and data item 2 together

I have used expression
tuple([CC75])+tuple([Total(CC11)])

This results in error in each fact cell for data item 3





Title: Re: adding 2 tuples
Post by: axxo on 26 Mar 2009 10:47:30 PM
It's now partly working. I have used member sets - I added [data item 1] (a total of cost centre 11) and [data item 2] (running total of cost centre 75) to a member set. Problem is [dataitem2] is a running total so when I try to add the 2 rows using total( [measure] within set set ([row_edge])) Cognos doesnt perform the running total on [dataitem2] first.

Any even vague ideas?
Title: Re: adding 2 tuples
Post by: axxo on 29 Mar 2009 11:04:03 PM
Adding 2 tuples in my crosstab wasnt too hard. Just created 2 tuples in my crosstab. Then 2 more data items that used the value() function to bring in each tuples value. Then add those 2 data items together [A] + ['B].

However, I belive it is impossible to do this if the data item you are trying to add uses a running-total() function. Simply impossible. Don't try it people I have wasted a LOT of time trying to do this just negotiate with your BA to have the report modified :)

Essentially what I am wanting to do is get a YTD (running total) of cost centre 11 from one level of a crosstab then subtract that from a MTD total of cost centre 75 that exists in another level of the crosstab. I can not do this when using running-total() I can however achieve success by removing the running-Total() effectively subtracting MTD of CC11 instead of YTD of CC11. Cognos does not know it has performed an error before the crosstab is produced, instead it outputs #!error in the fact cells.