I am a newbie, so apologies if this is a dumb question with a simple answer but I have searched the forum and tried this in the interface to no avail.
What am I trying to do?
I am showing data in a table and the field in the database is ‘dataprocessor’, but I want to display it in tables as ‘data processor’.
I am assuming that I can change this through custom mapping which is available in Admin->Data Model. However the option to select custom mapping does not exist in the Display Values field. - I only have one option which is ‘Use Original Value’.
I am using a MySQL database (if this makes a difference).
I am wondering if anyone has sucessfully got a CASE WHEN SQL statement to work in metabase, and if so if they can share thw sql on here. I am not having any success and suspect i am getting something wrong on syntax.
@Markbhai Not sure if part of your SQL is missing, but it doesn’t look correct - there’s two FROMs
When you’re using the Native query in Metabase, then you generally just have to follow the syntax rules of the database you’re querying (in your case MySQL).
This is an example using Sample Dataset (H2 database):
SELECT DISTINCT CASE CATEGORY WHEN 'Gizmo' THEN 'YES' ELSE CATEGORY END AS MyCat FROM PRODUCTS