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: 
epocin31
Contributor II
Contributor II

Filter Text field based on different values

Hello all,

I have this field 'Field 1' with rows composed of strings as follows:

Field 1
"Value1,Value2,Value3"
"Value4"
...
"Value21, Value1, Value23"

And I would like to filter this field based on the different 23 string "Values" (Values1,...,Values23) that migh composed a row of this field. For example, if I click on 'Value2' in the filter, it should display all the rows where 'Value2' is in it.

I think its possible to do it with 23 IF conditions but I was wondering if there is a better solution.

Thanks for your help.

Labels (5)
1 Solution

Accepted Solutions
Kushal_Chawda

@epocin31  you need to do it in script instead of front end

LOAD Field,

           subfield(Field,',') as Values

FROM table;

View solution in original post

8 Replies
epocin31
Contributor II
Contributor II
Author

I tried with 'subfield([Field1],',',1)' but this solution is partial because my filter only contains the first values of each string.

p_verkooijen
Partner - Specialist II
Partner - Specialist II

@epocin31 

Just use subfield([Field1],',') without the 3rd parameter (this is optional)

Qlik will create a row for each value

 

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunction...

 

 

epocin31
Contributor II
Contributor II
Author

Thanks for your answer, It works partially

  • I have one doublon in the filter parameters e.g., Value1, Value2, Value2
  • And some parameters dont filter properly
Kushal_Chawda

@epocin31  share sample data with expected output

epocin31
Contributor II
Contributor II
Author

Here is my file

The expected output is for example: when I click on 'Value1' its shows all the rows that contain 'Value1'

But I noted some anomalies with subfield:

exception.PNG

 

Kushal_Chawda

@epocin31  you need to do it in script instead of front end

LOAD Field,

           subfield(Field,',') as Values

FROM table;

epocin31
Contributor II
Contributor II
Author

There is no work-around  in the front-end?

I have some limitation in the back-end (professionnal usage)

Kushal_Chawda

@epocin31  If it is just about searching and filtering, you can use the wildcard search option of filter like below to select all values

Screenshot 2024-09-06 at 14.29.20.png