Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Median of count

HI,

I am new to Qlikview, and would like to obtain the median of a count distribution.

I have the following IDs.

ID
1
2
3
1
2
3
4
5
6
7
8
9
10
3
1
2
8
9
10

I would like to find the median, in this case, after sorting and adding, would be:

IDcount(ID)
41
51
61
71
82
92
102
13
23
33

the median of count(ID) is 2.  

How should the expression be?

thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try median(aggr(count(ID),ID))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Try median(aggr(count(ID),ID))


talk is cheap, supply exceeds demand
alexandros17
Partner - Champion III
Partner - Champion III

Use ID as dimension,

your expression is simply Count(ID)

and in sort promote Count(ID) and sort by numerivìcal values ascending

hope it helps

Not applicable
Author

I will try it. For Max and Min, what would be the syntax?

ie. Max(count(ID) and Min(count(ID)) does not work...

Gysbert_Wassenaar

You need to use the aggr function if you nest aggregation functions like sum, max, min etc.

max(aggr(count(ID),ID)

min(aggr(count(ID),ID)


talk is cheap, supply exceeds demand