COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: dunno on 16 Mar 2020 11:16:54 AM

Title: Crosstab - Query - Percentage
Post by: dunno on 16 Mar 2020 11:16:54 AM
Hi all (novice here)!

Here is how I've setup my crosstab in cognos 11 (report):
(https://i.imgur.com/257VKaL.png)

The Count is my measure.
I have everything working besides the column Difference.
I tried creating the following two queries, but nothing worked out:

Any hints?
Title: Re: Crosstab - Query - Percentage
Post by: srmoure on 17 Mar 2020 08:44:06 PM
Are you using a relational or a dimensional model ?
Title: Re: Crosstab - Query - Percentage
Post by: chr.93 on 31 Mar 2020 04:24:42 AM
Quote from: dunno on 16 Mar 2020 11:16:54 AM
Hi all (novice here)!

Here is how I've setup my crosstab in cognos 11 (report):
(https://i.imgur.com/257VKaL.png)

The Count is my measure.
I have everything working besides the column Difference.
I tried creating the following two queries, but nothing worked out:

  • Aggregate([Count] for [TypeOfProduct])
  • Aggregate([Count] for [TypeOfProduct], [LastYear]) - Aggregate([Count] for [TypeOfProduct], [ThisYear])

Any hints?


Hello!
An approach that I usually use in cases like this, is to create one query for the current year, one for the last year and to joined them in a third query(let's call it joined)
Then you will drag in the crosstab all the fields from both queries and create the difference in th Joined query.