Hello, even with the text() function, I get the error message “Types are incompatible” when using replace()? How can I better formulate the query? Regards, Martin
The replace() custom column function only accepts string literals (“quoted strings like this”) for the second and third arguments. You can’t use a column reference in those arguments, even if you cast the value.
At least on PostgreSQL, the database level replace() function does accept a column name/value as an argument, so you could write your query as a native query.
It's definitely possible with native SQL. I use the visual SQL builder to increase acceptance among my colleagues who are not developers. That's one of the advantages of Metabase.
Models and database views are your friends for preparing data for presentation and getting around Metabase limitations. Can’t do it in the notebook editor? Make a Model that uses a SQL query to fix it instead. Your users can use the Model as a base for their own notebook-based queries.