Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Omarelkerm
Contributor
Contributor

How to add numbers based on a certain Criteria

Hello Everyone, 

I am new to Qlik and had a quick question in regards to a chart I am trying to create. I have a table with a Status field and another field. The other field has a number and words in it. For example: 43-SR..................... I was able to pull in the numbers into another field by themselves using this function: Sum(num(SubField(Notes,'-',1))). The problem that I am facing is that I am looking to only add the Values if the Status field says ' Resolved' or ' Closed' If it says anything else I do not want the number to be added to the total KPI. Any help would be very much appreciated. In the Image below You can see the two fields in the table the Status Field and the Field  I was able to pull using the function states above. You can also see that the KPI says 688 which is incorrect. 688 is the correct number only if we add the fields where the status is not Resolved or Closed. I want the KPI as well as the total in the Chart to add only if the Status is ' Closed' or 'Resolved' 

Omarelkerm_0-1614698156378.png

 

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

what is the sum value here?

you can try this

Sum({<Ststaus={'Closed','Resolved'}>}num(SubField(Notes,'-',1)))

View solution in original post

2 Replies
Chanty4u
MVP
MVP

what is the sum value here?

you can try this

Sum({<Ststaus={'Closed','Resolved'}>}num(SubField(Notes,'-',1)))

Omarelkerm
Contributor
Contributor
Author

This Worked! Thank you so much!