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

If then else sum

I want to make a if then else sum in Qlikview that calculates

If Turnover*0,25 < 60, Then 60, Else Turnover * 0,25.

Can anyone help?

Updated with Qvw. Meddelandet redigerades av: Niklas Söderqvist

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Replace the label Turnover with the expression that it represents:  Sum(If(price*volume*0.0025<60, 60, price*volume * 0.0025))

talk is cheap, supply exceeds demand

View solution in original post

11 Replies
Gysbert_Wassenaar

Sum(If(Turnover*0,25 < 60, 60, Turnover * 0,25))


talk is cheap, supply exceeds demand
Not applicable
Author

Hey Gysbert tried that but it jsut gives me 0 on every row.

Not applicable
Author

If you look at the pic I attached you'll see

Gysbert_Wassenaar

Screenshots are bloody useless. Please post something with data that can be used to reproduce the issue.


talk is cheap, supply exceeds demand
sunny_talwar

Is turnover a field or expression here? or may be it is an expression label?

Not applicable
Author

Updated with a qvw i just copied your expression

Gysbert_Wassenaar

Replace the label Turnover with the expression that it represents:  Sum(If(price*volume*0.0025<60, 60, price*volume * 0.0025))

talk is cheap, supply exceeds demand
sunny_talwar

May be this?

Sum(Aggr(If(sum(price*volume)*0.0025 < 60, 60, sum(price*volume) * 0.0025), orderId, longName, buySell))

Not applicable
Author

Yeah that worked! thanks man!

Problem was I used label of the expression instead of the expression it represented!

Cheers!