Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HOW TO USE IF & WILDMATCH TOGETHER ?

Hi All,

I have a filed "A" with some 100 values.

I have to assign some group to a particular value and rest of it should be in "NA" group.

The code used is :-

if(wildmatch(A),'*Sarang*'),Group 1,

if(wildmatch(A),'*Nitika*),Group2,))

Now i want the rest of the values to be shown in "NA"..... how do i do it?

I tried :-

1)

if(wildmatch(A),'*Sarang*'),'Group 1',

if(wildmatch(A),'*Nitika*),'Group2','NA'))

2)

if(wildmatch(A),'*Sarang*'),'Group 1','NA'

if(wildmatch(A),'*Nitika*),'Group2','NA'))

IT DOES NOT WORK.

Please help

'

8 Replies
somenathroy
Creator III
Creator III

Hi,

The below statement should works :

if(WildMatch(A,'*Sarang*'),'Group 1',

if(WildMatch(A,'*Nitika*'),'Group 2','NA')

) as Group

I think it's a opening and closing parenthesis problem.

Regards,

som

Not applicable
Author

Hi,

I am able to assign values to Group 1 & group 2.

But I am unable to assign the remaining values to "NA".

PLEASE HELP

sushil353
Master II
Master II

Please post the sample application..

I could not find any issue in

if(WildMatch(A,'*Sarang*'),'Group 1',

if(WildMatch(A,'*Nitika*'),'Group 2','NA')

) as Group

HTH

Sushil

er_mohit
Master II
Master II

if(wildMATCH5(A,'*Sarang*'),'Group 1',

if(wildMATCH5(A,'*Nitika*'),'Group 2','NA')) as Group

jeffmartins
Partner - Creator II
Partner - Creator II

Hi sarangmehta,

This should works:

pick( 1+wildmatch(A,'*Sarang*','*Nitika*'),

                        'NA', 'Group 1', 'Group 2') as Group

Hope this helps you.

Regards

Not applicable
Author

Hi Jeff,

Tried ur solution but dsnt work.

The data type is huge clob at database level. The data consists of different names in upper /lower case as well as 1-2 page of mails.

so we are using wildmatch and '*SARANG*' to get the required result.

Also there may be a possibility that  value = 'SARANG' may be present in mails also.

So i want to assign values that consits of only  'SARANG' in group 1 and rest of the emails in 'NA'.

Appreciate your help.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Is it possible for you to post some example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jeffmartins
Partner - Creator II
Partner - Creator II

Hi sarangmehta,

In this case you should try the match() function instead of the wildmatch().

pick( 1+match(A,'Sarang','Nitika'),

                   'NA', 'Group 1', 'Group 2') as Group

Hope this helps you.

Regards