Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
DipeshVadgama
Partner - Creator II
Partner - Creator II

how check if text does not Contains & Contains

Dear All,

I am trying to do script calculation in Qlik Sense. I am trying to find if Fields contains & does not contains particular word in a field.

Eg

Field_name

Hyd

Hyd

Hyd,Sec,Hyd-Sec

E-Hyd,Sec

E-Hyd,Old

Sec,Hyd

count(if(field contains "Hyd"and not contains "E-Hyd",1,0) as Countvalue

So I should get a output value = 4 (which contains Hyd but not E-Hyd)

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

Sum(If(WildMatch(field, '*Hyd*') > 0 And Wildmatch(field, '*E-Hyd*') = 0, 1, 0)) as Countvalue

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

Sum(If(WildMatch(field, '*Hyd*') > 0 And Wildmatch(field, '*E-Hyd*') = 0, 1, 0)) as Countvalue

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Hi Dinesh,

Try using WildMatch.

Count(if(not match(Field_name,'E-Hyd'),Field_name))

try using to create a kpi in UI.

Please let me know if u have any questions.

DipeshVadgama
Partner - Creator II
Partner - Creator II
Author

Thanks 🙂