Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

sum(if) for a specific selection

Hi all,

I want to use the sum(if)-function for a specific selection (all values between 3999 and 5000). My idea is like this, but it doesen't work:

sum(if(booking> 3999 and booking< 5000, cost)) as cost_special

Thank you for your help!

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

try this

sum(rangeonly(if(booking>3999 and booking<5000,cost)as cost_special

View solution in original post

10 Replies
Not applicable
Author

Hi,

Try this

IF(SUM(booking)>3999 AND SUM(booking)<5000,cost) as cost_special

er_mohit
Master II
Master II

try this

sum(rangeonly(if(booking>3999 and booking<5000,cost)as cost_special

Not applicable
Author

sum( total if(booking> 3999 and booking< 5000, cost)) as cost_special

Not applicable
Author

Hi,

Try this

IF(SUM(booking)>3999 AND SUM(booking)<5000,SUM(cost)) as cost_special

sivarajs
Specialist II
Specialist II

sum({<booking={">3999<5000"}>}cost)

Anonymous
Not applicable
Author

Thank you, but it doesn't work. QV says that there is a skript mistake.

Anonymous
Not applicable
Author

Thank you, but it doesn't work. QV says that there is a skript mistake.

sivarajs
Specialist II
Specialist II

Set analysis wont work with script.Did you use Group by clause in your table

Load * sum(x)as tmp

from x.qvd group by y;

Anonymous
Not applicable
Author

Thank you very much!! It works...