Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
asammon
Contributor
Contributor

count if a condition is met on another field

Trying to build a more complex expression for a KPI. 

I want to only count the number of rows of apple in the "fruit" column if the amount is 5 or more.

So I like to see Apple count is 2 because there is 2 apple rows where the amount is 5 or higher. My expression is just not working.

Here is my expression:

Count({$<[fruit]={"Apple"}>,[Amount]={">5"}>})

It tells me there is an error in my expression: '}' expected, What does that mean. data below. Thanks.

 

Screen Shot 2022-04-13 at 6.30.02 PM.png

 

 

Labels (2)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Count({$<[fruit]={'Apple'},[Amount]={">=5"}>} fruit)

Few corrections are made that are highlighted and removed one extra '>'. Also check and make necessary change if your field names are correct, i.e. - 'fruit' and 'Fruit' are different.

View solution in original post

2 Replies
tresesco
MVP
MVP

Try like:

Count({$<[fruit]={'Apple'},[Amount]={">=5"}>} fruit)

Few corrections are made that are highlighted and removed one extra '>'. Also check and make necessary change if your field names are correct, i.e. - 'fruit' and 'Fruit' are different.

asammon
Contributor
Contributor
Author

Thank you Tresesco! It worked.