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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count expression with if

Hy guys!

I need a help to resolve a little problem with my count expression...

i have a field (Numbers of interventions) and i need to count this field only if the sum of hours of interventions are > 20.

I try to do the expression...but it doesn't work...

sum(if(sum(aggr(sum(VAL_SKP), COD_PDR))>20,1,0))

Thank you for help!!!!

3 Replies
swuehl
MVP
MVP

Maybe like

=sum( aggr( if( sum(VAL_SKP) > 20, 1,0), COD_PDR))

but I am pretty unsure what you need here. Could you upload a small sample application?

rustyfishbones
Master II
Master II

You could try

SUM({<VAL_SKP ={">20"}>}COD_PDR)

Not applicable
Author

i have a table like the first two column...

the point is that i need to sum 1 only if is verified the condition sum(aggr(sum(val_skp),cod_pdr))>20...if this condition is ok then i sum 1, else 0. condition works well but the "then" instruction doesn't work. it is because there are sum operator outside and inside if instructions. Have u got some suggestions?

thx a lot

COD_PDR

VAL_SKPSUM(ORE_PDR_INTER)
60,54
317617010,380,76
341120010,52
319528010,541,08
319528020,541,08
323177011,543,08
346514031,543,08
317167010,420,84
346366010,420,84
357203011,676,68
342991010,541,08
343351020,541,08
330403011,543,08
500343011,543,08
500372011,543,08
330224010,541,08
312904010,270,54
312904020,270,54
345614020,270,54
345726020,270,54
345729020,270,54
345735050,270,54
327085010,51