Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AzuEnM
Contributor II

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!

Labels (1)
1 Solution

Accepted Solutions
madelonjansen
Partner Ambassador

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.

View solution in original post

2 Replies
madelonjansen
Partner Ambassador

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.

AzuEnM
Contributor II
Author

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?