COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Cognos_Jan2017 on 26 Mar 2018 12:42:18 PM

Title: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 26 Mar 2018 12:42:18 PM
We have a Column calculation of 'Show_Contributing Factor' ...

Case
When ([IIMS - Business Layer].[Contributing Factor].[Contributing Factor] <> '')Then [Contributing Factor]
Else
'No Entry'
End

This populates a text entry in a Coulumn in all rows in a List.

We are utilizing a Combination Chart where the 2nd Y-axis is a Percentage of the defined
'Contributing Factor' divided by the Count (Show_Contributing_Factor).

Writing a query calculation of ...
Count ([Show_Contributing_Factor] For [Incident Location])

SHOULD Count, in our example, 9 ... but it counts 11.

Have tried various Detail and Summary Aggregation entries,
but always get 11 or 22.

Utilizing the "Sigma" (Totals) of a Column, and selecting Count
results in a Summary Row of ...
Count(Show_Contributing_Factor) ... w/ the CORRECT value of 9.

The Properties for that correct Cell Value of 9, under "Data Item" are ...
Type = List summary
Name = Count(Show_Contributing_Factor)
Summary data item = Show_Contributing_Factor
Summary = Count

How can we quantify ...
Count(Show_Contributing_Factor) ... w/ the CORRECT value of 9
to use as a denominator in the Percentage calculations for each
Contributing Factor?

TIA, Bob
Title: Re: Getting The Correct Count for a Column as a &quot;List Summary&quot;
Post by: Kiran P on 26 Mar 2018 12:50:46 PM
You can use count(distinct [show_contributingFactor]) which only counts the distinct values ignoring any repetitions.

Thanks
Kiran

Sent from my ZUK Z2132 using Tapatalk

Title: Re: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 26 Mar 2018 12:55:54 PM
What about 2 or more entries for a 'Contributing Factor'?
Title: Re: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 26 Mar 2018 01:02:33 PM
That DOES, in this example, result in "4", which is the number
of different Contributing Factor descriptions.
Title: Re: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 26 Mar 2018 01:17:11 PM
It appears that a Repeater in the List is adding "2" to the anticipated "9" to result in 11.

We have a Query Calculation that, on one row, is displaying "3" where it should be a "1".
Will examine why the Query Calculation might be doing that.
Title: Re: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 26 Mar 2018 02:18:05 PM
Trying several things, which are NOT working.

IF there is a reliable way to accomplish this (from my 1st Post in this Topic) ... The Repeater appears to be confusing Counts, but BELOW results in the Value needed for the denominator in the Percentage calculation.
Utilizing the "Sigma" (Totals) of a Column, and selecting Count
results in a Summary Row of ...
Count(Show_Contributing_Factor) ... w/ the CORRECT value of 9.

The Properties for that correct Cell Value of 9, under "Data Item" are ...
Type = List summary
Name = Count(Show_Contributing_Factor)
Summary data item = Show_Contributing_Factor
Summary = Count

How can we quantify ...
Count(Show_Contributing_Factor) ... w/ the CORRECT value of 9
to use as a denominator in the Percentage calculations for each
Contributing Factor?

TIA, Bob
Title: Re: Getting The Correct Count for a Column as a "List Summary"
Post by: Cognos_Jan2017 on 27 Mar 2018 11:12:26 AM
Example ...

Incident Location   ID
Lexington              AAA
Lexington              BBB
Lexington              CCC
Lexington              DDD
Lexington              AAA
Lexington              EEE
Lexington              AAA
Lexington              FFF
Lexington              GGG

A Query Calculation of ...
Count ([ID] For [Incident Location])
... results in 7, because there are 7 distinct ID entries.

What we need is a result of 9, as the 9 will be the denominator
to calculate percentages for the 2nd-axis in a Combination Chart.

There would be counts of ...
AAA = 3
BBB = 1
CCC = 1
DDD = 1
EEE = 1
FFF = 1
GGG = 1

Is there a Query Calculation utilizing [ID] and [Incident Location]
to result in 9?

TIA, Bob