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: 
Not applicable

How to filter over rows with If?

Hi, why do i miss the two amounts of Orderno 2 in the second table?

Screen.png

1 Solution

Accepted Solutions
Gysbert_Wassenaar

The problem is that your if statement doesn't aggregate. So for any OrderNo with more than one record it can't determine which sum(Amount) it should use. Sum(200) or sum(120).

What you probably want is the other way around: sum(if(PartGroup='PartB' and left(PartNo,1)=3,Amount)).

You can rewrite that to a set analysis expression:

sum({<PartGroup={'PartB'},PartNo={"=left(PartNo,1)=3"}>} Amount)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

The problem is that your if statement doesn't aggregate. So for any OrderNo with more than one record it can't determine which sum(Amount) it should use. Sum(200) or sum(120).

What you probably want is the other way around: sum(if(PartGroup='PartB' and left(PartNo,1)=3,Amount)).

You can rewrite that to a set analysis expression:

sum({<PartGroup={'PartB'},PartNo={"=left(PartNo,1)=3"}>} Amount)


talk is cheap, supply exceeds demand
Not applicable
Author

Hi, perfect. Thanks! Zach.