Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if and wildmatch

if(wildmatch(EName,'SCOTT') >=1,Empno,

if(wildmatch(EName,'KING','President') and MGR = 'NULL',Empno,

What the above script will do?

Please explain.

Thanks in advance.

3 Replies
Anonymous
Not applicable
Author

Hi,

WildMatch is used for a match where a string can be part of the search string.

Syntax:

wildmatch( str, expr1 [ , expr2,...exprN ] )

The wildmatch function performs a case insensitive comparison and permits the use of wildcard characters ( * and ?) in the comparison strings.

Example:

wildmatch( M, 'ja*','fe?','mar')

returns 1 if M = January

returns 2 if M = fex

Regards

Neetha

jpapador
Partner - Specialist
Partner - Specialist

If it finds SCOTT (case sensitive) in the field ename it will give you the empno in those records.  If it's not 'SCOTT' it will look for 'KING' or 'President' (again case matters) if it finds either of those EXACTLY as they are given in the script and the MGR field is null it will give you the empno for those records.  If neither of those conditions are found it will return NULL.

WildMatch is essentially the same as match if you do not use a WildCard ('*' or '?') in the if statement.

Anonymous
Not applicable
Author

In Ename field ,if scott value is found it gives matching Empno for that record,else

its checks for values 'KING' or 'President'  and MGR field  is Null it gives matching Empno for that record.

and no match found it returns Null.