Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Finding if value exists inside field

I have a field called CitiesWithFactory. It contains cities that have cars in the factory of the city.

for example I have New York, London and Berlin, if Berlin doesn't have any cars at the moment the field would look like this:

CitiesWithFactory: New York, London

I have a button for each city which I want to disable if there are no cars in it.

How do I check if the field contains the city?

4 Replies
swuehl
MVP
MVP

Maybe like

=Count({1<CitiesWithFactory *= {'Berlin'} >} CitiesWithFactory) >0

Anonymous
Not applicable
Author

you can use function FindOneOf

for each button you can define

if (FindOneOf(CitiesWithFactory,'Berlin')>0   if Berlin is in List it Returns the Position of the text, otherwise 0

you can use conditional layout to Show or hide button

marcus_sommer

I think it could be helpful if you splitted this field within the script, for example with a subfield-function like:

table:

Load

     ID, /* relation to other tables probably per datefield and others*/

     subfield(CitiesWithFactory, ',') as CitiesWithFactory,

     SomeOtherFields

From xyz;


Often it's easier to use normal fields and not such combined values which it make only difficult without any further value.

- Marcus

swuehl
MVP
MVP

Actually that's what I assumed - that your field CitiesWithFactory has several values, one for each city, not a single concatenated value.

Both versions should be supported by

=WildMatch( Concat(DISTINCT CitiesWithFactory, ', '), '*Berlin*') >0