COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: limkw on 08 Jul 2015 03:37:05 AM

Title: Need help on total
Post by: limkw on 08 Jul 2015 03:37:05 AM
Hi,

I have been trying to find out what is the problems with no avail. I have data item label z output with this syntax
case when ([Feature code] = '0934') or ([Feature code] = '0935') or ([Feature code] = '7091')
then
count ( distinct [MACSR] )
else
0
end

then I create another data item total z with this syntax

total ([z output])

The issue is the data item z output have 1 on some row but the total z is 0.  I thought is datatype problem and I cast it to integer but problem still persist.  Can someone in this community provide what is the issue and how to rectify it? Or is there alternative method of doing it?
Attached output file.
Title: Re: Need help on total
Post by: gpollock on 08 Jul 2015 01:51:33 PM
I'm still trying to wrap my head around what exactly you're trying to do.  The Z Output column is designed to show the count of unique MACSR when certain conditions are correct, and then you want to total it up on the same row?

Try setting the aggregate and rollup aggregate functions.  First, set aggregate to calculated, and rollup aggregate to total.  What happens now?  If that doesn't work, set both to calculated.  Either of these should get your summary rows working.  Finally, use the solve order to your advantage.  Tell Cognos that Z Output should be solved before the total.

If none of those work, could you please provide more detail for what the correct output should look like?
Title: Re: Need help on total
Post by: timness on 09 Jul 2015 12:37:05 PM
Quote from: gpollock on 08 Jul 2015 01:51:33 PM
I'm still trying to wrap my head around what exactly you're trying to do.  The Z Output column is designed to show the count of unique MACSR when certain conditions are correct, and then you want to total it up on the same row?

Try setting the aggregate and rollup aggregate functions.  First, set aggregate to calculated, and rollup aggregate to total.  What happens now?  If that doesn't work, set both to calculated.  Either of these should get your summary rows working.  Finally, use the solve order to your advantage.  Tell Cognos that Z Output should be solved before the total.

If none of those work, could you please provide more detail for what the correct output should look like?
I agree - is there a reason you're trying to calculate a running total rather than putting a total at the bottom of your list?



sent form my g-note4

Title: Re: Need help on total
Post by: shelby435 on 09 Jul 2015 01:31:18 PM
you might want to try changing the solve order of the z total to 2.