Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stascher
Partner - Creator II
Partner - Creator II

Ignoring dimensions in part of Bar Chart expression.

Given the following table

SubjectInjurySeverity
BobKnee2
BobLeg3
JaneFoot1
JaneHand2
ZachKnee3
ZachHand2

 

I want to make a stacked bar chart with Injury as one dimension and Severity as the other.

I want a measure that (for each Injury and Severity) counts the number of people who had that injury and severity, and then divide that number by the total number of subjects (regardless of Injury/Severity) in order to derive the frequency of each injury/severity. 

I know the numerator of the expression is a simple count(distinct Subject), but I don't know how to get the denominator to work. 

Any help would be appreciated. 

Thanks,

Steve

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You will need to use TOTAL in your calculation. So your denominator could look like this:
=count( distinct total [Subject])

View solution in original post

4 Replies
Vegar
MVP
MVP

You will need to use TOTAL in your calculation. So your denominator could look like this:
=count( distinct total [Subject])

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Griffin20
Contributor
Contributor

But ignoring dimensions would be not of much use..Infact it can spoil entire design for the project  mykfcexperience

Vegar
MVP
MVP

You might want to adjust your expression  count(distinct Subject)/count(distinct total Subject) based on which dimensions you want to present the quote value.

For overriding a dimension in your total you put it inside <> right after the TOTAL, like this:

count(distinct Subject)/count(distinct total <Injury> Subject)

 

Read more on the TOTAL feature here: https://help.qlik.com/en-US/sense/April2019/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/define-a...