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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
eddy9657
Contributor
Contributor

Decile analysis with filter

Hi All,

I am using below logic  from https://community.qlik.com/t5/QlikView-App-Dev/Decile-analysis/td-p/1223944.

=Aggr(

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.1), 10,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.2), 9,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.3), 8,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.4), 7,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.5), 6,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.6), 5,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.7), 4,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.8), 3,

if(Sum(Profit) <= fractile(TOTAL Aggr(Sum(Profit), Customer), 0.9), 2, 1))))))))), Customer)

 

However , I want to create a filter to only show 10% or 20% or 30% customer. How can I create this filter.

After I create a filter pane by using this logic. When I select 10% it will continue the divide 10 part from the 10% of customer. The user can't identify they already select 10%.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need to add the set {1} into your expression to indicate ignore selections. 

if(Sum({1}Profit) <= fractile({1}TOTAL Aggr(Sum({1}Profit), Customer), 0.2), 9,

I think it's a little more efficient to calculate the decile rather than the multiple If(). Like this:

=Aggr(
Ceil(Rank(Sum({1}Profit),4,1) / count({1}DISTINCT TOTAL Customer), 0.1) * 10
, Customer) 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

3 Replies
eddy9657
Contributor
Contributor
Author

Can anyone help 🙌

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need to add the set {1} into your expression to indicate ignore selections. 

if(Sum({1}Profit) <= fractile({1}TOTAL Aggr(Sum({1}Profit), Customer), 0.2), 9,

I think it's a little more efficient to calculate the decile rather than the multiple If(). Like this:

=Aggr(
Ceil(Rank(Sum({1}Profit),4,1) / count({1}DISTINCT TOTAL Customer), 0.1) * 10
, Customer) 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

eddy9657
Contributor
Contributor
Author

Hi Rwunderlich , Thank you so much for your help.