Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Given the following table
Subject | Injury | Severity |
Bob | Knee | 2 |
Bob | Leg | 3 |
Jane | Foot | 1 |
Jane | Hand | 2 |
Zach | Knee | 3 |
Zach | Hand | 2 |
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
You will need to use TOTAL in your calculation. So your denominator could look like this:
=count( distinct total [Subject])
You will need to use TOTAL in your calculation. So your denominator could look like this:
=count( distinct total [Subject])
But ignoring dimensions would be not of much use..Infact it can spoil entire design for the project mykfcexperience
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...