Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
doganatasoy
Contributor
Contributor

Sum if count distinct result greater than value

Hi All,

 

I am quite new in qlik view, and I got below expression to calculate Worker performance.

My dimension is Worker 

(sum(if([Process Code]='107', [Manufactured Qty])))
/
(sum(if(Deleted='No',[Planning Qty])))

I want to run this function for who worked more than 50 work orders. (count(distinct(WO))>50

Regards,

Dogan

 

Labels (2)
1 Solution

Accepted Solutions
__alebra__
Partner - Contributor II
Partner - Contributor II

Hi , 

try in this way:

 

if (count(distinct(WO))>50, sum(if([Process Code]='107', [Manufactured Qty])) sum(if(Deleted='No',[Planning Qty])))

 

but you will have better performance if you use the set analysis:

if (count(distinct(WO))>50, sum({<[Process Code]= {'107'}>} [Manufactured Qty]) / sum({<Deleted={'No'}>}[Planning Qty]))

 

Ciao

Ale

 

View solution in original post

2 Replies
__alebra__
Partner - Contributor II
Partner - Contributor II

Hi , 

try in this way:

 

if (count(distinct(WO))>50, sum(if([Process Code]='107', [Manufactured Qty])) sum(if(Deleted='No',[Planning Qty])))

 

but you will have better performance if you use the set analysis:

if (count(distinct(WO))>50, sum({<[Process Code]= {'107'}>} [Manufactured Qty]) / sum({<Deleted={'No'}>}[Planning Qty]))

 

Ciao

Ale

 

doganatasoy
Contributor
Contributor
Author

Set analysis worked, thanks for your help.

Regards,
Dogan