Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Listbox which impacts a different field?

I have a situation where a given record may have multiple "Tags" associated with it.  The tags are stored in a varchar(max) field in the database and each tag is comma separated.  I also have a table of all possible tags.

What I need to do is give the users a listbox of the possible tags (a stand-alone table), and then use something on the other field which filters the data in a wildcard manner (LIKE)?  So if the user selects Tag1 and Tag2 from the listbox.  The actual data field may have values like "Tag1" for one record but "Tag7,Tag4,Tag2" in another.  I need it to identify all records which have any of the relevant values anywhere in it and have that as the filter.

Can I have a listbox on one field but have the filter apply to a different field in a wildcard manner and the wildcard by dynamic depending on how many values they select?

Thanks.

Mark.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Mark,

I don't see a problem.  You can do it all using that list box, no artificial complications needed.  See attached.

Regards,

Michael

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Mark,

Here is a way how to implement this.  For example, you have a table named DATA that contains this field with comma-separated tags.  Let's assume the field name is Tags.  Create additional logical table:

LOAD DISTINCT
Tags,
trim(subfield(Tags,',')) as Tag
RESIDENT DATA;

Now, the field Tag contains all values, and selections in this field will return the result you need.

Regards,
Michael

Not applicable
Author

Thanks Michael,

I currently have a separate table that has all the distinct tag values.  However, using that field for a listbox does me no good as it does not filter the table which has the data I want.

The data I want to filter also has a Tags field but there the tags are a comma delimited string.  What I need is to be able to select a tag from the listbox on the dimensional table, and have it effect the field on the data table.  It also needs to be a "Like" match "Like '%Tag1%', '%Tag2%'", etc.  Thus, if I select multiple items in the dimensional listbox, I'll need to create a match string that will dynamically be used to filter the main data set.

Regards,

Mark.

Anonymous
Not applicable
Author

Mark,

I don't see a problem.  You can do it all using that list box, no artificial complications needed.  See attached.

Regards,

Michael

Not applicable
Author

Sorry, I didn't understand the solution you were talking about as I read it initially.  Seeing it in action confirms that will do exactly as I need.

Thank you.

Anonymous
Not applicable
Author

Thanks for confirmation Mark.  I thought one time maybe I got the requirements wrong...