Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
adias102
Contributor III
Contributor III

KPI - calculate median and max value

Hi,

I have a dashboard which displays several KPIs and I need to calculate 2 other KPIs: one for the median value and one for the max value.

I have 2 dimensions: Year and Stations.

I have 2 KPIs:

one shows the number of events for the chosen years and stations.
count(distinct EventID)

The second shows the toal number of events for the chosen years, ignoring the stations dimension.
count({$<Stations=>} distinct EventID)

How do I calculate the median and the max value for the stations? These KPIs should display a fix value, no matter which station is chosen (like the total number of events).

I tried something like median(aggr(count(distinct EventID), Stations)) but it only shows the correct value when no station is chosen. What is the correct syntax for the medin?

Labels (2)
1 Solution

Accepted Solutions
Dalton_Ruer
Employee
Employee

You would need to introduce Set Analysis and use {1} which will exclude all user selections. 

I have attached a Set Analysis workshop I wrote and pages 3 and 4 will explain that to you. And then you have workshop in case you want to read more about it. 

View solution in original post

2 Replies
Dalton_Ruer
Employee
Employee

You would need to introduce Set Analysis and use {1} which will exclude all user selections. 

I have attached a Set Analysis workshop I wrote and pages 3 and 4 will explain that to you. And then you have workshop in case you want to read more about it. 

View solution in original post

adias102
Contributor III
Contributor III
Author

Thank you, this was very helpful 🙂