Filtering on part of string

Humberto Cabbagepatch shared this question 7 years ago
Answered

Hello,


I'm trying to design a report, off of which I'll produce charts. I want to create a filter with several "contains" values. Here's what I mean:


Let's say hypothetically, you have a "fruit baskets" table. This table has 2 fields: FruitBasketNumber and Contents. "FruitBasketNumber" is your primary (super) key and "Contents" is just a string with the contents of the basket.


So an example record might be:

FruitBasketNumber | Contents

#1 | Apples**Oranges**Pears**Plums**Melons**Bananas**


I want to be able to create "buttons" that let users select records that contain one or more parts of the string (e.g. "Apples", "Oranges", etc). So, a user should be able to press the "filter" button, select "apples", and see all records where apples are somewhere in the contents. A user should be able to select "Apples" and "Bananas" and see only FruitBaskets which have both Apples and Bananas. I do not consider it a good enough solution that a user can type in "apples".


The closest thing I've found so far is selecting "contains" in advanced filters, but I'm not sure what this is supposed to do. It seems to filter in the report creation rather than create the option to filter (I'm assuming that I just don't understand the mechanics).


Any ideas? How do I accomplish this?


Thank you very much.

Replies (2)

photo
1

Hi,

I have created 2 different tables as below on MySQL


229f2483a3dbc95d8e9022cd90d5cd94


Create a view and report with Fruitbasket table and in the report add contents into filters and do the step below:


a027e83cde4756018ffcd540b2806b26


SQL statement in step1 while bring all the fruits and cache them.


Then when you run the report you can get those filters working in the report as follows:


5e3c00d1a1079655486bb53b55a241de


Please let me know if this is what you want to do or if you have any questions.


Regards,


Mahe

photo
1

Hi,


Can you please update me on this case?

Please let me know if you need further help or any questions.


Regards,


Mahe

Leave a Comment
 
Attach a file