Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to exclude items when the title contain a specific string

Hello,

I would like to calculate the sum of items, but only when their title doesn't include a specific string.

for example, here is my list

Titlenumber
Banana20
Apple10
Apple Test15
Strawberry1
Mango testing2
test2

So basically what I want is to have only Banana + Apple +Strawberry and ignore anything that contains "test" in it.

It's just an example, my table got hundreds of lines.

I tried this

Sum({$<SubStringCount([Title], 'test')={0}>}[number])  but it doesn't seem to be working.

Any idea?

Thank you so much

1 Solution

Accepted Solutions
sunny_talwar

Seems to be working for me here

Capture.PNG

View solution in original post

9 Replies
sunny_talwar

May be this

Sum({<Title -= {'Test', 'test', 'TEST'}>}number)

Anonymous
Not applicable
Author

Hello Sunny,

Thank you,

is there anyway to include all the possible syntax of "test", beacause I have also "testing" or "tester"

Thanks a lot,

sunny_talwar

My bad, try this

Sum({<Title -= {'*Test*', '*test*', '*TEST*'}>}number)

Anonymous
Not applicable
Author

This one didn't work, it returned to me all  the values, as '*' was actually considered as a character..

sunny_talwar

Oh are you on the most recent version of QlikView or Qlik Sense? Try with double quotes instead of single quotes

Sum({<Title -= {"*Test*", "*test*", "*TEST*"}>}number)

Anonymous
Not applicable
Author

Yes, I'm on Qlik Sense, and actually title = or title -= didn't work neither, it didn't include for example 'Mango Testing and "Apple Test" 😕

sunny_talwar

"*Test*" is not excluding those two values? Really? Going to test it out now

sunny_talwar

Seems to be working for me here

Capture.PNG

Anonymous
Not applicable
Author

Thank you so much Sunny, I tried it again and it's working fine.  Perfect