COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: HelloCognos on 09 Aug 2018 06:33:32 AM

Title: Adding two specific row's values in Crosstab (Analytics)
Post by: HelloCognos on 09 Aug 2018 06:33:32 AM
Ok, I have been struggling with this one for a while.  :) :)

I need add up two rows values and show it in a third row in a List or Crosstab.

Please see my mockup attached.

I tried using the new Calculation Data Item but it is not working.

Thanks again for your time.
Title: Re: Adding two specific row's values in Crosstab (Analytics)
Post by: sdf on 09 Aug 2018 07:51:01 AM
have you tried to add a crosstab space?
Title: Re: Adding two specific row's values in Crosstab (Analytics)
Post by: HelloCognos on 09 Aug 2018 08:07:57 AM
Well, the issue I'm having is to how perform the calculation of the specific rows to be added together. Sure, Crosstab Space is a good idea but it seems to be more involved. Thanks a lot
Title: Re: Adding two specific row's values in Crosstab (Analytics)
Post by: Lynn on 10 Aug 2018 02:20:29 AM
Quote from: HelloCognos on 09 Aug 2018 06:33:32 AM
Ok, I have been struggling with this one for a while.  :) :)

I need add up two rows values and show it in a third row in a List or Crosstab.

Please see my mockup attached.

I tried using the new Calculation Data Item but it is not working.

Thanks again for your time.

Is your source relational or dimensional?

If it is dimensional, bring in the elements as individual members rather than a set of members. Then you can click the two desired members and create your calculation.

If it is relational, create a query calculation using a case statement to aggregate your metric for the two desired types.


case [Your Cost Type Field]
  when 'Maint Cost' then [Your Value Field]
  when 'Repair Cost' then [Your Value Field]
else 0
end

Title: Re: Adding two specific row's values in Crosstab (Analytics)
Post by: HelloCognos on 10 Aug 2018 06:17:53 AM
Thanks so much Lynn! I'll try this.
Title: RESOLVED: Adding two specific row's values in Crosstab (Analytics)
Post by: HelloCognos on 12 Aug 2018 07:45:22 AM
Lynn, :)

This approach worked perfectly for adding up couple of rows and showing them in a different row. Once the addition is showing, I excluded the others that were included in the addition from the Crosstab. Works like a charm.

Created the Measure based on the Case Statement. Assigned the Data Item as Summary Calculation: Calculated and drop it to the Crosstab.

Thank you again!