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

how to use wildcard in if

I have this field call Load_Berth and Discharge_Berth, which is

A01

A02

A03

B01

B02

B03

First letter A and B means place such as A stands for Australia and B stands for Brazil. Basicallly this field will tell you tht this particular person was loaded to a bus at this berth and discharge at this berth

I would want to find passengers that load and berth at the same country

So my code is if(Load_Berth = {'A*'} and Discharge)Berth = {'A*'},'Intra-Country')

However it seems that it is not working,

is my wildcard usage wrong

thanks

5 Replies
tresesco
MVP
MVP

Use WildMatch() like below:

if( WildMatch(Load_Berth,'A*')  and WildMatch(Discharge_Berth,'A*') ,'Intra-Country')

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

if(Left(Load_Berth, 1) = 'A' and Left(Discharge_Berth, 1) = 'A', 'Intra-Country') -------------- for Australia

if(Left(Load_Berth, 1) = Left(Discharge_Berth, 1), 'Intra-Country') ------------for all countries

Hope this helps you.

Regadrs,

Jagan.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

A solution may be:

if(left(Load_Berth,1) = left(Discharge_Berth,1) 'Intra-country')

-Rob

n1ef5ng1
Creator
Creator
Author

I understand that Qlikview if statement do not flow down. Meaning once A was use for the first if statement, i will not be able to use another if statement for A in the same dimension

If(Left(Load,Berth,1) = 'A' and Left(Discharge_Berth,1) = 'A','Intra-Country)

if(Left(Load.Berth,1) = 'A' and Left(Discharge_Berth,1) = 'B','Aust-Brazil')

will the second if statement flow down?

tresesco
MVP
MVP

Hello Bennn,

you are right, for same dimension it would not. But aren't 'Load.Berth' and 'Discharge_Berth' different dimensions ?  Please share a sample app with explained expected output.