Filtering multiple values in a field

I’m looking for solutions to filter my dashboard for fields that contain multiple options.

Is there away to search if a field contains 1 of the options?

For the field “Impacted Vertical”, I want to be able to show all rows that contain “HPB”. So if the field contains “HPB, SPB”, that row will appear.

I tried creating a parameter with each option in a separate line. But when I select “HPB”, the row with “HPB, SPB” doesn’t appear. I don’t have much experience with parameters so I may be doing something wrong.

Hi @tainga
what do you mean by

creating a parameter with each option in a separate line

Can you share the parameter and control value definition?

BR

Here is the parameter I created:

And here is the control linked to that parameter

@tainga
“Vertical impact” is the same as “vertical impact checkbox”?
And the filter for “vertical impact” is linked to the verticals parameter?

Yeah, they are the same.

Do you mean if the control is linked to the verticals parameter? I don’t have a filter set up because when I link it to the parameter, it has to be equal to the options. I am looking for a filter for when I select 1 vertical, it shows the rows that contain it. Right now, I would need to have a list of options for all variables of the 5 options I have in the filter

If I understand the use case, you can try using ‘contains’ filter instead of ‘equals’ and populate the checkbox with single values only, not the concatenated permutation combination.

If you select XX then it would select all text that contains XX. Just be aware that ‘contains’ filter will consider substring as well. So based on the use case you may need to retune the application likewise.

The ‘contains’ filter would work but I can’t assign the parameter to it. I want to be able to select multiple options from a drop-down list instead of typing out what I want to filter for.


.

Unfortunately contains does not work with multiselect parameters.

Another workaround that I can think of is a bit complex. Lets break it in steps.

  1. Configure the parameter control as free text taking input as comma separated value for example “CPB” to be entered by the user, or for multiple select “CPB, HPB” to be entered by the user. Fix a limit as how many values can one enter. For example, we can mention - allows only 15 values to be filtered at 1 time.
  2. create a calculated field using split to split the filter values based on comma as delimiter and check the substring presence for each string.
    e.g. ifelse(contains({field to be filtered}, split($filter paramater,‘,’,1),CASE_INSENSITIVE),1,
    contains({field to be filtered}, split($filter paramater,‘,’,2),CASE_INSENSITIVE),1,0)
  3. Use this calculated field to filter 1s.

For reference of what are the expected value that can be input in the filter parameter, you may need to add a separate text with list of available values.

I’m getting this error in the calculated field with a new parameter (Vert) after following your step 1

Can you try with locate instead of contains? Instead of True/false it should return numeric position and 0 for no match cases.

I still get an error with locate

Please check the syntax of locate. also locate is case sensitive, so you may need to change cases before you check.

try something like:

ifelse(isNotNull(split(${test1},‘,’,1)),
locate(toLower(AccountName),toLower(trim(split(${test1},‘,’,1)))),0)
+
ifelse(isNotNull(split(${test1},‘,’,2)),
locate(toLower(AccountName),toLower(trim(split(${test1},‘,’,2)))),
0)

you will have to add as many splits as you plan to support in the text field. Here is have considered only 2.

1 Like