Filters on a text variable using LIKE '%%'

I’ve been playing around with filters and tried to filter a text variable to find all elements that matched partially the text input. I tried different variations of ‘[[WHERE text_column LIKE ‘%{{text_variable}}%’ ]]’ but I couldn’t make it work. Is this actually possible (if so, please enlighten me :slight_smile: ) or is there a reason why it can’t be done?

Thanks

3 Likes

I am also having this problem. If anyone else knows proper syntax to make this work I’d love to hear it.

yeah me too! Just tried to do it with the latest update, no dice.

If the text field is {{text_here}} and then you use the regex command in the provided box it will work, but that’s a pain for non-technical users :confused:

Figured it out!

Created from Member 
        where ReferredBy is not null
        and ReferredBy like "%"{{referrer}}"%"

That adds regex commands into the output.

5 Likes

This does not seem to work for me. Still trying to figure it out.

Works for me on 0.22, thanks!

1 Like

Another solution, try to use CONCAT(’%’,{{variable}},’%’) such as:

WHERE 1=1
[[ AND test LIKE CONCAT(’%’,{{variable}},’%’) ]]

13 Likes

this works for me, also with multiple variables like that in on query. Thanks!!

[[where text_column LIKE ‘%’ || {{text_variable}} || ‘%’]] works for me on Redshift

3 Likes

[[ AND name LIKE ‘%’||{{variable}}||’%’]]

4 Likes

This works flawlessly, thanks for the help

1 Like

Works excellently for me as well, just be mindful of your quotation marks

1 Like