Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum + Condicion ?

What function i can use for Sum + Condition

Exemple

A  B   C    Total    Total(only >10)

10 20 20    50      40

I'm searching for function and Set Analysis tutorial.

TNKs

2 Replies
swuehl
MVP
MVP

You could  embed an if() in a sum() function, for example if you have a field A with values

LOAD * INLINE [

A

10

20

20

];

the expression would look like

=sum( if(A>10, A))

(read as sum of A values if value > 10)

Using Set Analysis it could be something like

=sum({<A= {">10"}>} A)

Or do you have three different fields A,B,C you want to add, but only operands larger than 10? Do you want to create a new field in the script or creating a total value in the front end? The solution could probably look pretty similar to above, in the script, you can't use set analysis, but you could create a new field and use the if() function, maybe like

LOAD A,B,C,

rangesum(If(A>10,A), if(B>10,B), if(C>10,C) ) as Total

FROM ....

Hope this helps,

Stefan

Not applicable
Author

TNX !!

rangesum(If(A>10,A), if(B>10,B), if(C>10,C) )

Perfect