Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
suryaa30
Creator II
Creator II

Calculating Percentile

Hi I have created a chart as seen below


Cumulative Salary.PNG

Expression used:

Count =Count({<Hypothesis_Flag={'1'}>}DISTINCT Poliza)

Count %=Count({<Hypothesis_Flag={'1'}>}DISTINCT Poliza)/Count({<Hypothesis_Flag={'1'},Monthly_Salary_Updated={"*"},Monthly_Salary_Updated={">0"}>} TOTAL DISTINCT Poliza)

Cumulative Count=RangeSum(Above(Count({<Hypothesis_Flag={'1'}>}DISTINCT Poliza),0,RowNo()))

Cumulative Count%=RangeSum(Above(Count({<Hypothesis_Flag={'1'}>}DISTINCT Poliza),0,RowNo()))/Count({<Hypothesis_Flag={'1'},Monthly_Salary_Updated={"*"},Monthly_Salary_Updated={">0"}>} TOTAL DISTINCT Poliza)

Please ignore the set expression part in above expression , it is simply count (Policy)/Count(TOTAL Policy) and calculation of accumulation using range sum 

I want the expression to populate highlighted values in a text box or in a table. something like below. What is the count of policies that have salary greater than the 95th percentile and what is the 95 percentile of the salary. similarly for 96,97,98 and 99.  Please note the values populated below are dummy.

percentile 2.PNG

13 Replies
Kushal_Chawda

may be for 95 percentile

Fractile(aggr(Count({<Hypothesis_Flag={'1'}>}DISTINCT Poliza),Salary),0.95)

suryaa30
Creator II
Creator II
Author

Thanks Kusha. I am not getting the desired results. Let me try the variations and get back to you.

Kushal_Chawda

Is your salary bucket is calculated dimension?

Kushal_Chawda

In my expression I have assumed that, Salary is your Salary Bucket which is created in the back end

sunny_talwar

Are you working with QV12.1 or above? If yes, then you might be able to use Aggr() function to do this

Recipe for a Pareto Analysis – Revisited

suryaa30
Creator II
Creator II
Author

Yes it is a calculated dimension.

=IF(Monthly_Salary_Updated>0,DUAL(Replace(Class(Monthly_Salary_Updated,$(vIncomeBucket)),'<= x <',' - '),Class(Monthly_Salary_Updated,$(vIncomeBucket))))

Salary calculated.PNG

suryaa30
Creator II
Creator II
Author

It is version 11.2

sunny_talwar

You are going to have a tough time to achieve what you are looking for using QV11.2. Can you upgrade to QV12.1?

suryaa30
Creator II
Creator II
Author

Also is it possible to show my dimensions as 0-30K, 30K-35K instead of 0-30000,3 0000-35000.

My calculated dimension using bucketing is as below. The zeroes occupy too much space in graph

=IF(Monthly_Salary_Updated>0,DUAL(Replace(Class(Monthly_Salary_Updated,$(vIncomeBucket)),'<= x <',' - '),Class(Monthly_Salary_Updated,$(vIncomeBucket))))