Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking to create an if statement that is based on a field having a range of possible values.
Example:
In SQL, you would write:
If fieldA in ["value1","value2"...] Then
....
How can I translate this into QV syntax?
Thanks,
Hi, use the funciotion Match()
If(Match(Field,'value1','value2',....), Value True, Value False)
Best Regards.
Tonial.
Have a look at the QlikView Match() or WildMatch() functions.
Is there a way to do this using a range instead of typing all values?
Take the following:
001-015
Instead of typing each possible value out, could I enter a range into the Match function?
you can't use a range in match function, you have to type all values
in wildmatch you can use wildcard (* ?)
or for range you can use a sql like syntax also in Qlik load
where field1 >= '009' and field1 <= '021';
Something like this should work:
Pick(Match(Round(FieldA,015),0,15,30,45,60,75,90,105),'A','B','C','D','E','F','G','H')
If you have trouble with it I'd convert your field to a number.