I have no idea how to do this with custom SQL and BQ, but I have created wildcard text searches using the following calculation:
IF CONTAINS([Description],[Search Text]) Then 'Show'
[Description] refers to the text field I want searched, and [Search Text] is a parameter (string, with allowable values set to all).
Have you tried this approach?
Thanks for the reply. Unfortunately, in this case the above wont work as our tables are quite yuge and I am trying to delegate that work to BQ. After getting off the phone with support, there was little they could offer for a fix. I am trying the CONTAINS predicate in Tableau with little luck as well.
I'll report back if I find a solution in the documents support sent over.
Applying what Allison has suggested
would do the job exactly as you want it to do --
Tableau would send a query to BQ like that:
SELECT SUM(CAST(1 AS INT64)) AS `sum_Number_of_Records_ok`,
1 AS `X__alias__0`
FROM `publicdata.samples`.`wikipedia` `wikipedia`
WHERE (STRPOS( `title`, 'google' ) > 0)
GROUP BY 2
The WHERE condition is build by the Parameter & Filter combination.
The above code is caught by Performance Recording
using the wikipedia dataset from BQ publicdata.samples scheme.
The dataset has around 300M rows, and the query time is 1.5 sec.
So (generally speaking) the performance should not be a problem here.
Please find the attached version 10.1 workbook.
Hope it could be applied to your case, too.
BQ_Search_Filter_10.1_YF.twbx 10.4 KB
while this is quite an old post, this might save someone else's time as it took me long to be able to get this to work.
Instead of writing: