Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Meg00
Contributor III
Contributor III

Exclude selectable values from fields in listbox

Hi!

I'm trying to figure out how to exclude certain values to be selectable in a field.

There's a very long list of values and I only want the selectable values to equal 'W00*' and 'W1*'.

Would be awesome if anyone could help:)

 

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Create a new field in the script that stores only those values:

If(Left(Field, 3) = 'W00' OR Left(Field, 2) = 'W1', Field, Null()) AS New_Field

Check the parentheses, though.

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Create a new field in the script that stores only those values:

If(Left(Field, 3) = 'W00' OR Left(Field, 2) = 'W1', Field, Null()) AS New_Field

Check the parentheses, though.

marcus_sommer

You could use a simple if-condition within a listbox-expression for it. Another and maybe better way would be to categorize these field within the script to create a main- and maybe even n sub-groups and using them as an additionally listbox to restrict the data.

- Marcus

Meg00
Contributor III
Contributor III
Author

Thanks, I tried IF with Match but that didn't work, Left worked much better!

Miguel_Angel_Baeyens

Just for the sake of the example, the following will work with WildMatch().

If(WildMatch(Field, 'W00*', 'W1*') > 0, Field, Null()) AS New_Field

Match() does not allow wildcards such as "*" or "?", WildMatch() does.