Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
I'm new to Qlik. Example i have below type of data with two columns(field A, field B),
in field B have some 'empty' and '-'values. Here i need a new "field C" wherever field B have 'empty' and '-' then field C have to show "VEGAN" otherwise it have show "NONVEGAN".
For this I wrote this code like this,
TMP:
load [Field A],[field B],
If([field B]='' or '-', 'VEGAN','NONVEGAN ') as [field C]
From..........
Result is
But here the if condition is not working where field B has'-' values.
Can anyone help me to learn this type cases.
Thank you in advance.
Hi @Martin098
try to use -
If(len([field B])<2, 'VEGAN','NONVEGAN ') as [field C]
Hi @Martin098
try to use -
If(len([field B])<2, 'VEGAN','NONVEGAN ') as [field C]
As below
If(Len(Trim([Field B]))=0,'VEGAN','NONVEGAN') as [Field C]
If([field B]='' or IsNull([field B]), 'VEGAN','NONVEGAN ') as [field C]