Ability to search through "tags" in a single field on my table

I have a column and the tags are set at “abc;def;hij;”

What I’m thinking is we can add in different tags in the search field just like when you can search on multiple.

We would be able to add the delimiter directly in that search field.

So the field would be (“abc”, “def”, “hij”)
And when it generates in sql it would be “(Column like ‘%abc;%’ or Column like ‘%def;%’ or column like ‘’%hij;%')”

I hope this makes sense.

Hi @abivelj

Can you please provide us with a screenshot of the table column and the filter you’re working on? That’d help us understand your request better.

Thank you! :slight_smile:

This is all theoretical here.

Let’s pretend that the Condition Filter for tags looks like this:
image
and those are the tags. Or even if you did it with the delimiter added to the name:

After you start searching the special “Tags” field knows to make the sql query look like this:

SELECT * FROM dbo.Table t
WHERE (T.Tags LIKE ‘%Concord POS;%’ OR T.tags LIKE ‘%Thing;%’ OR T.tags like ‘%abc;%’)

Hi @abivelj

Thank you so much for your prompt reply and the example.

Our team’ve discusses and it looks like your request can be interpreted in different ways. Can you pls confirm on which interpretation is correct?

:one: Interpretation #1: You want a faster/convenient way to input values into the filter.

  • You have a use case of creating a filter for: Field A is ‘Concord POS’ or ‘Lightspeed’ or ‘abc’

  • Currently in our filter, you have to input each individual value. For example, you have to type in ‘Concord POS’ to create a tag of Concord POS, and then type in ‘Lightspeed’ to create a tag of Lightspeed, and so on → It’s too much work.

  • So you want to be able to… let’s say… copy paste a whole string of ‘Concord POS; Lightspeed; abc’ into the filter’s input box. The query will look like this:
    SELECT * FROM dbo.Table t
    WHERE (T.Tags IN (‘Concord POS’, ‘Lightspeed’, ‘abc’))

  • If that’s the case, you can select and copy values from your table and paste them into the filter, like so:


:two: Interpretation #2: You want to be able to create a CONTAINS OR filter but our CONTAINS filter doesn’t support it yet, so you have to use IS OR filter.

  • You have a use case of creating a filter for: Field A contains ‘Concord POS’ or ‘Lightspeed’ or ‘abc’
  • Currently in our CONTAINS filter in the Visualization Setting, you can input only 1 value. That’s why you’re using IS filter instead, so you can input multiple values for OR condition.
  • The query will look like this:
    SELECT * FROM dbo.Table t
    WHERE (T.Tags LIKE ‘%Concord POS%’ OR T.tags LIKE ‘%Thing%’ OR T.tags like ‘%abc%’)
  • If that’s the case, we recommend you to try out this Condition Group feature. You can create multiple CONTAINS conditions and set OR between them. It’ll look like this:

:three: Interpretation #3: You want the platform to automatically add the semicolon (“;”) into every single value?

  • The reason why we have such interpretation is because in your SQL query example, we notice there’s semicolon (“;”) between % characters. This’s where we get confused.
    SELECT * FROM dbo.Table t
    WHERE (T.Tags LIKE ‘%Concord POS;%’ OR T.tags LIKE ‘%Thing;%’ OR T.tags like ‘%abc;%’)

#1 cannot work because all the tags are written in one field like “Lightpseed;ConcordPOS;abc;def;etc;”

#2 would work. That’s exactly what I was trying to accomplish.

#3 what I mean is do what you did in #2, but if you have a two tags that are similar: for example “lightspeed;lightspeed retail;”
If you search for “%lightspeed%” you’ll get both lightspeed and lightspeed retail. So by adding the semicolon in at the end it does a separation of the tag.
If one row has a tag of “lightspeed;” and another row has a tag of “lightspeed retail;” you will select both rows when you were only trying to select one of the rows.

That’s what I mean, but looking at your example #2 will work for what I’m trying to do.

2 Likes

Hi @abivelj

I’m glad our Condition Group feature can help you with your use case :slightly_smiling_face:

Please give it a try and let us know if you have any questions or feedback.

Cheers!

1 Like