5 Replies Latest reply: Sep 27, 2013 2:36 AM by Tresesco B

# 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

• ###### Re: how to use wildcard in if

Use WildMatch() like below:

• ###### Re: how to use wildcard in if

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.

Jagan.

• ###### Re: how to use wildcard in if

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?

• ###### Re: how to use wildcard in if

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.

• ###### Re: how to use wildcard in if

A solution may be: