Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
There's a field Media in my data with three possible values: TV, Press, Internet.
There's a list-box Media in my QlikView file.
I'm using the following function to get selected values:
Variable1=GetFieldSelections(Media)
E.g. if all media are selected, then Variable1 = TV, Press, Internet.
Now I have to set the following condition:
if Variable1 includes 'TV', then return 1, else return 0.
How can I define this condition using QlikView syntax?
Thank you in advance,
Larisa
There are many ways. For example
if(index(Variable1, 'TV'), 1,0)
Or this might also work
If(SubStringCount(Variable1, 'TV') = 1, 1, 0)
or you can do this directly without the if statement
SubStringCount(Variable1, 'TV')
HTH
Best,
Sunny
Thank you!