Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

if statement

is it possible to have if condition with 2 values for ex:

if country = france  then 'Europe' ,'french' else 'other'...

europe and french should be 2 diff values.

10 Replies
Anil_Babu_Samineni

May be this?

If((country = 'france', 'Europe') or (country = 'france', 'french'), 'other')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prat1507
Specialist
Specialist

Where are you planning to use this and why do you want it as two values and not a single value like Europe,French.

Regards
Pratyush

raadwiptec
Creator II
Creator II
Author

because europe and french is refereeed as 2 different dimension in our database and the values diff little when you select europe and french seperately

raadwiptec
Creator II
Creator II
Author

hi anil

can you also suggest the same for multiple countries.. ex: if country like france ,italy, spain then 'Europe' ,'french' else 'other'...

Anil_Babu_Samineni

Here we go !!

If((Match(country, 'france', 'italy', 'spain'), 'Europe') or (Match(country, 'france', 'italy', 'spain'), 'french'), 'other')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
t_chetirbok
Creator III
Creator III

do you want to have two rows for one Country in the table?

t_chetirbok
Creator III
Creator III

something wrong

If(

     (     Match(country, 'france', 'italy', 'spain'), 'Europe')

or (     Match(country, 'france', 'italy', 'spain'), 'french')

, 'other')

did you want to put additional if before match?

raadwiptec
Creator II
Creator II
Author

hi anil,

there is some problem with the syntax.. iam not able to figure out. syntax ..below all the scripts gets black

raadwiptec
Creator II
Creator II
Author

hi tats, yes indeed