Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Median of count

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

4 Replies

Re: Median of count

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

Re: Median of count

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

Highlighted
Not applicable

Re: Median of count

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

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

Re: Median of count

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)