COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: lukasz921 on 14 Nov 2019 12:22:25 PM

Title: Cross Tab - is it possible ?
Post by: lukasz921 on 14 Nov 2019 12:22:25 PM
I have dataset in the format:
(https://i.postimg.cc/mchy3Tz6/data.jpg)
Can I do crosstab report and add row with calculate ?
(https://i.postimg.cc/fbS2VKjz/data-crosstab.jpg)
Title: Re: Cross Tab - is it possible ?
Post by: ThatKingslayer on 15 Nov 2019 09:28:52 AM
I am not entirely sure what you are asking as it looks like a word or two might be missing, however, if your question is whether or not it is possible to add Total or Summary lines to a crosstab on a report, the answer is 'Yes'.
Title: Re: Cross Tab - is it possible ?
Post by: lukasz921 on 15 Nov 2019 12:15:15 PM
Thanks for reply. No I want add next row in crosstab but this row calculated before previous row
Title: Re: Cross Tab - is it possible ?
Post by: BigChris on 18 Nov 2019 04:28:05 AM
I'm also a little confused, and that might just be a lack of coffee on my part. In your example, are you only interested in calculating the last line on your crosstab? Do you, for example, want to calculate nameB - nameA as well? It looks like your dataset is sorted in quantity sequence...what happens / what do you want to calculate when the quantity is the same for two names?
Title: Re: Cross Tab - is it possible ?
Post by: CognosPaul on 18 Nov 2019 02:01:02 PM
Try this:

case [name]
when "nameC" then currentMeasure 
when "nameB" then currentMeasure * -1
else 0
end


set the aggregation to total