Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

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: 
Not applicable

How does the median function work

Hello everyone!

I am just all sorts of confused on the median function. I just want to display the median of three numbers as a boundary on my gauge chart. I thought it would be like rangemedian(#,##,###) like the rangemax and rangemin functions, However, upon further research it's supposed to look like this (maybe?):

median( [{set_expression}] [ total [<fld {,fld}>] ] expression )

I just need to know how to set is up so I get the median of sum(x), sum(y), and sum(z).Thanks for all your help!

1 Solution

Accepted Solutions
rwunderlich

Following Aaron's suggestion:

RangeFractile(0.5, sum(x), sum(y), sum(z))

-Rob

View solution in original post

4 Replies
morganaaron
Specialist
Specialist

Hello!

I believe the expression you want to use is RangeFractile - you can use it along with a fractile value of 0.5 and your three expressions. See the help entry below:

rangefractile (0.5, above(sum(x),-1,3))returns the median of the three results of the sum(x) function evaluated on the row below the current row, the current row and the row above the current row.
Not applicable
Author

I'm sorry; I'm still confused. Can you write out the whole thing with the three sums? This makes even less sense to me. Thanks for your help!

Not applicable
Author

I don't mean a function sum(x). I mean sum of some field name like sum(Quantity). That was probably confusing. Sorry!

rwunderlich

Following Aaron's suggestion:

RangeFractile(0.5, sum(x), sum(y), sum(z))

-Rob

View solution in original post