Dooley
Databricks Employee
Databricks Employee

So looking at this more closely, this looks like a Tableau problem. To go from that nice SELECT statement to this mess looks like a bug on Tableau's side. I mean look at the query, "WHEN (0 IS NULL) THEN NULL" and then "WHEN 0 < 1 THEN INSTR( `salesforce_export_1_explorium_15sept2022`.`Emails`, '}' )" When is 0 not less than 1? Why does a filter have to have an CASE statement like that for a filter? You see these strange portions of the query repeated in that SQL beast like a broken record.

I'm not sure why a WHERE clause wouldn't work so here is my work around Tableau, change the SQL query and create a table that does the filter and then read that into Tableau.

CREATE TABLE add_new_tablename_here AS SELECT `salesforce_export_1_explorium_15sept2022_professional_email_val`.`Status` AS `status`
FROM `default`.`salesforce_export_1_explorium_15sept2022_professional_email_validation` `salesforce_export_1_explorium_15sept2022_professional_email_val`
GROUP BY 1
ORDER BY `status` ASC
WHERE column_you_are_filter_clause_goes_here

I hope this helps.