Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fractile and Count in a dimension

Hello,

I am trying to divide the number of inscriptions in 10 in a dimension to have decile like you can have quartile or mediane in excel.

So I tried this but it seems that you cannot use the fonction "Count" in a Dimension...

=if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.1), 1,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.2), 2,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.3), 3,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.4), 4,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.5), 5,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.6), 6,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.7), 7,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.8), 8,
if(count( @num_insc) <= fractile( TOTAL count( @num_insc), 0.9), 9, 10)))))))))

3 Replies
danielrozental
Master II
Master II

Clement, you can use Count but if you're using an expression you need to aggregate it by a dimension.

fractile( TOTAL aggr(count( @num_insc),DIMENSION), 0.9)

Anonymous
Not applicable
Author

Thank you Daniel.

I would like to use it in a dimension. Is it possible ?

danielrozental
Master II
Master II

Wouldn't make much sense, just use a field with values 0.1, 0.2, ... etc.