Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
elakkians
Partner - Contributor III
Partner - Contributor III

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
sunny_talwar

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)

View solution in original post

marcus_sommer

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

View solution in original post

3 Replies
sunny_talwar

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)
marcus_sommer

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

elakkians
Partner - Contributor III
Partner - Contributor III
Author

Thanks its working .