
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calculating the median of a measure in a table
Hi! I have been trying to calculate the median of a measure as values of a table for quite some time. My measures are summations of electricity meter data from different meters using a set expression.
Here is an example:
Sum({<Meternumber={'123-4567891', '123-4567892'}>} Metervalues)
The display of the sum in a table calculated by the measure works beautifully, however Qlik Sense does not let me build the median of this measure. This would be very helpful to quickly compare the previous day's data with the consumption oft the previous 3 months.
I am relatively new to Qlik Sense, so I would greatly appreciate an example or detailed explanation.
Thank you very much!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Median of the outcomes depends on what dimension you are using in the table.
Try this:
Median(Aggr(Sum({<Meternumber={'123-4567891', '123-4567892'}>} Metervalues), <yourdimension>))
-- replace <yourdimension> with the dimension that you use.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Median of the outcomes depends on what dimension you are using in the table.
Try this:
Median(Aggr(Sum({<Meternumber={'123-4567891', '123-4567892'}>} Metervalues), <yourdimension>))
-- replace <yourdimension> with the dimension that you use.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works great! Thank you so much!
Do you know if its possible to set a fixed time span like the last 3 months for the calculation of the median, regardless what the filters of the worksheet are?
