nachico
September 27, 2016, 3:37pm
1
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 ) or is there a reason why it can’t be done?
Thanks
3 Likes
moso
October 24, 2016, 3:51am
2
I am also having this problem. If anyone else knows proper syntax to make this work I’d love to hear it.
kapziel
November 3, 2016, 10:49pm
3
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
kapziel
November 3, 2016, 10:57pm
4
Figured it out!
Created from Member
where ReferredBy is not null
and ReferredBy like "%"{{referrer}}"%"
That adds regex commands into the output.
6 Likes
This does not seem to work for me. Still trying to figure it out.
Sitnik
January 24, 2017, 1:03pm
6
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}},’%’) ]]
11 Likes
EvaS
July 28, 2017, 1:04pm
8
this works for me, also with multiple variables like that in on query. Thanks!!
elia
October 4, 2018, 9:16am
9
[[where text_column LIKE ‘%’ || {{text_variable}} || ‘%’]] works for me on Redshift
3 Likes
fujun
October 10, 2018, 9:16am
10
[[ AND name LIKE '%'||{{variable}}||'%']]
4 Likes
This works flawlessly, thanks for the help
lvdv
November 13, 2019, 7:49am
12
Works excellently for me as well, just be mindful of your quotation marks
Hello, it works for me like this
WHERE start_preparation_error::text like '%44%}'
add this after the field name:
::text like '%text to search%}'
Cheers!