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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wildmatch - compare two fields

Hi,

I want to compare 2 field values with WildMatch, for example, Model and SModel both contain ABC and should be recognized as 'match'. But the wildmatch here does exact match. How to solve the problem? Thanks.

LOAD if(wildmatch(Model , SModel),1,0) AS Flag

;

LOAD * INLINE [

    Model , SModel

   ABC, ABC D

];

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

What does qualify a match in your context?

If you want to know if Model is part of SModel, try like this using wildcards '*':

LOAD *, if(wildmatch(SModel , '*'&Model&'*'),1,0) AS Flag

;

LOAD * INLINE [

    Model , SModel

   ABC, ABC D

];

or if you want to know if Model is part SModel or SModel is part of Model:

LOAD *, if(wildmatch(SModel , '*'&Model&'*') or wildmatch(Model , '*'&SModel&'*'),1,0) AS Flag

;

LOAD * INLINE [

    Model , SModel

   ABC, ABC D

];

The matching will be case insensitive, but checking if the e.g. Model is fully contained within SModel.

View solution in original post

2 Replies
swuehl
Champion III
Champion III

What does qualify a match in your context?

If you want to know if Model is part of SModel, try like this using wildcards '*':

LOAD *, if(wildmatch(SModel , '*'&Model&'*'),1,0) AS Flag

;

LOAD * INLINE [

    Model , SModel

   ABC, ABC D

];

or if you want to know if Model is part SModel or SModel is part of Model:

LOAD *, if(wildmatch(SModel , '*'&Model&'*') or wildmatch(Model , '*'&SModel&'*'),1,0) AS Flag

;

LOAD * INLINE [

    Model , SModel

   ABC, ABC D

];

The matching will be case insensitive, but checking if the e.g. Model is fully contained within SModel.

Not applicable
Author

Thank you! Exactly what I am looking for!