Qlik Community

Qlik Sense App Development

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

Partner
Partner

Find Median for a row value

Hi All,

Need to find the median for the below data set in a straight table in qlik sense

 

Week 1Week 2Week 3Week 4Week 5Week 6Week 7
2040106344521

 

 

2 Solutions

Accepted Solutions
Highlighted

Re: Find Median for a row value

Is Week a dimension or do you have different columns for each Week? If Week is a dimension, try

Median(Data)

otherwise try

RangeFractile(0.5, Week1, Week2, Week3, Week4, Week5, Week6, Week7)
MVP & Luminary
MVP & Luminary

Re: Find Median for a row value

Maybe a pivot with week as horizontal dimension would be more suitable and then you could use something like:

median(aggr(YourExpression, Week, FurtherDimensions))

If these weeks are all different fields I suggest a transforming with a CROSSTABLE statement whereby you could also do it with something like:

rangefractile(0.5, [Week 1], [Week 2], ...)

- Marcus

3 Replies
Highlighted

Re: Find Median for a row value

Is Week a dimension or do you have different columns for each Week? If Week is a dimension, try

Median(Data)

otherwise try

RangeFractile(0.5, Week1, Week2, Week3, Week4, Week5, Week6, Week7)
MVP & Luminary
MVP & Luminary

Re: Find Median for a row value

Maybe a pivot with week as horizontal dimension would be more suitable and then you could use something like:

median(aggr(YourExpression, Week, FurtherDimensions))

If these weeks are all different fields I suggest a transforming with a CROSSTABLE statement whereby you could also do it with something like:

rangefractile(0.5, [Week 1], [Week 2], ...)

- Marcus

Partner
Partner

Re: Find Median for a row value

Thanks its working .