Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
kdstrin1
Contributor II
Contributor II

Filter to Search on Value in Multiple Fields

Hello. I'm trying to build a filter that would select records from a large dataset where a certain value is found in any of columns listed. Below is my code but i'm receiving an error in expression message. Any assistance you can offer is appreciated

=if(
(
WildMatch('00B00ZX',PrincipalDiagnosisCD),
OR if WildMatch('00B00ZX',OtherDiagnosis1CD),
OR if WildMatch('00B00ZX',OtherDiagnosis2CD),
OR if WildMatch('00B00ZX',OtherDiagnosis3CD),
OR if WildMatch('00B00ZX',OtherDiagnosis4CD),
OR if WildMatch('00B00ZX',OtherDiagnosis5CD)
)
,'yes','no')

 

 

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

I believe you're not using IF() and Wildmatch() syntax right. And if I understand what you're trying to achieve then try this

IF(WildMatch(PrincipalDiagnosisCD,'*00B00ZX*')
or WildMatch(OtherDiagnosis1CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis2CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis3CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis4CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis5CD,'*00B00ZX*'),'Yes','No')

View solution in original post

3 Replies
BrunPierre
Partner - Master
Partner - Master

I believe you're not using IF() and Wildmatch() syntax right. And if I understand what you're trying to achieve then try this

IF(WildMatch(PrincipalDiagnosisCD,'*00B00ZX*')
or WildMatch(OtherDiagnosis1CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis2CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis3CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis4CD,'*00B00ZX*')
or WildMatch(OtherDiagnosis5CD,'*00B00ZX*'),'Yes','No')

MarcoWedel

If(PrincipalDiagnosisCD&'/'&
   OtherDiagnosis1CD&'/'&
   OtherDiagnosis2CD&'/'&
   OtherDiagnosis3CD&'/'&
   OtherDiagnosis4CD&'/'&
   OtherDiagnosis5CD like '*00B00ZX*'
   ,'yes','no')
kdstrin1
Contributor II
Contributor II
Author

This seems to have worked. Thank you!