Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
ID | count(ID) |
4 | 1 |
5 | 1 |
6 | 1 |
7 | 1 |
8 | 2 |
9 | 2 |
10 | 2 |
1 | 3 |
2 | 3 |
3 | 3 |
the median of count(ID) is 2.
How should the expression be?
thanks!
Try median(aggr(count(ID),ID))
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
I will try it. For Max and Min, what would be the syntax?
ie. Max(count(ID) and Min(count(ID)) does not work...
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)