String filter in dashboard - contains several values

It’s possible to filter dashboard data based on a string field, using the contains method and including several values in that contains?

For example,
Filter: list_of_ingredients (string that has all the ingredients of a product)
Want to: list of ingredientes contains: ‘potatoes’ ‘olive oil’ → which in sql would be something similar to → lower(list_of_ingredients) like ‘%potatoes%’ AND lower(list_of_ingredients) like ‘%olive oil%’
Result: all the products whose ingredients include, between others, potatoes and olive oil

Thank you!!

4 Likes

Hi Marta,

Unfortunately, the dashboard filters have not supported multiple value inputs for “Contains” operator yet. We might add it in the near future, so the filters would be more flexible for you.

That said, here are some workarounds for your case, depending on how your data is stored.

Case 1: If many products share the exact same recipe from the list_of_ingredients.
→ In this case, I would suggest you try the “IS” syntax for the ‘list_of_ingredients’ filter, and select the values you want from the drop-down. This drop-down list should show all distinct values of 'list_of_ingredients'.
This should take much less effort for you in this situation.

Let me give you an example with my “Countries & cities” dashboard’s filter:

Case 2: If each product has its own unique recipe from the list_of_ingredients.
→ Since the filter conditions on a dashboard are currently linked with each other by the AND operators, you can: add a filter where ‘field_1’ contains ‘string_a’, and then another filter with ‘field_1’ contains ‘string_b’ (and so on). This should get you the result where ‘field_1’ contains both ‘string_a’ and ‘string_b’ inside it.

Example for it here:

Please let me know if this helps!

Hi again!
thanks for the answer, but unfortunately those workarounds do not help us out in this case.

The thing is that in my use case the field in the filter has several ingredients as shown in the picture:
image

and I would like to filter by several values that are included in the string.

For instance I would like to filter writing: “aceite de coco puro” and “zanahoria” so the dashboard shows just the recipes that contains those two string as part of the list of ingredients.

We had to discard:

  • one field per ingredient (ingredients are infinite)
  • filter by “is” and several words → as we always have the whole ingredients string in that field.
  • several filters of the same (We would have to include at least 6 of those but have a look how many filters do we have right now, could be crazy)

that’s why contains: ‘potatoes’ ‘olive oil’ would be perfect for us :slight_smile:

1 Like

Hi @Marta_Garrido,

Thank you for replying with great details, we really appreciate it! We have got the context & drawbacks you are having with these workarounds.

I’m sorry that currently the Contains operator in our Text filter hasn’t supported multiple string values inside yet. However we do have plans to support this, and will start working on it soon.
Will get back to you when there are any updates on it!

Thank you so much for your patience and understanding, Marta!
All the best to you and the team.

1 Like

Wow! Great to here that :smiley:

Thank you very much Vu Duong!

Hi again!

We have been testing how it would work when that feature it’s ready :star_struck: :crossed_fingers:.
And we have a suggestion to complement it. Once that’s ready, our aim is to have the list of unique options listed in the filter but then using “contains” those chosen options are looked for/filtered in the whole string.

To do so, we have created a master table with the unique values and other column with the whole string (so each row will create as many rows as unique values has in the whole string - for the unique values column - and the whole string in the other column for all of them).
Then we have include the table in Holistics with the relationship needed with the main table (whole string of this aux table 1-M to the whole string in the main table). Then we have use the unique values in the filter but then we filter the reports using the fields that contains the whole string. The problem is that when using “contains” the list of possible values are not displayed. Could be an optional check or so to be able to display them in “contains” filter too?

I understand that other use cases, if you use contains is to look for whatever so that’s why the list was not contemplated as needed, but in this would be very necessary :slight_smile:

Thank you very much!

Hi guys… it’s been over a year since this issue was raised and I am in the same situation. @vu.duong has there been any progress on adding this feature?

hi @LucasYoung Nice to e-meet you :smiley:
To help us better understand your case, would you mind sharing with us if you want to filter (1) Field A contains X or Y, or (2) Field A contains X and Y, or both?
We would appreciate it if you could share with us your real use case :smiley:

Hi,
I now created an account to also comment on this question, since we have been waiting for this feature and keep seeing that there is no progress.
We need Contains X or Y or … in the same fashion as the “IS” allows the logical “or”. We have a list of labels in a column that we need to search for certain keywords. We cannot use matches, since the list is variable, in a non fixed ordering.

What are the plans for this feature? Is it maybe on some kind of Roadmap, in the meanwhile? If not: what is the problem around this implementation?

Best,
Maria

Hi Maria,

Thank you for being patient with us. We’re eager to announce that a solution for this problem is under development at the moment and will tentatively be launched in mid Jan 2024. The unofficial name for the feature is Condition Group for now.

With Condition Group, you can create multiple OR conditions, including “contain” conditions. I’ve attached here a prototype to show how it will look like.

Although this solution doesn’t solve your specific use case in the leanest way, it covers other use cases which have been repeatedly sent to us, such as: support multiple “contain” inputs for AND condition, support OR between different fields, and support nested AND/OR conditions.

After the first implementation phase this Jan, the feature will be available at Report/Exploration level. For Dashboard level, we’re currently doing our research and product design, so please kindly bear with us.

To make sure this feature will serve your needs better, can you please share with us your use case:

  • Who often need to do this kind of filtering? Data analysts or Explorers?
  • Can you give us a real-life example of this “contain” filtering question?
  • Is this filtering question often posed in ad-hoc or regular basis?
  • Will you need to reuse/apply the same filter in different reports/dashboards?

Your answers would help us a lot in perfecting our solution. We look forward to hearing back from you soon.

Best regards,
Phuong.

Hi @Marta_Garrido, @LucasYoung and @Maria,

Thank you so much for being patient with us. Condition Group is finally live! This feature will help you create multiple “OR” conditions and nest “AND”, “OR” conditions into groups.

Check out our Release Note here and give it a try. And don’t hesitate to let us know if you have any feedback or question :blush:

Cheers,
Phuong.