Create custom column based on condition

Hi,
I am able to do this in SQL but cant figure how to do this using the UI create column feature

Here is scenario

SELECT item_count, created_on,
CASE
WHEN item_count < 1 THEN 'Failure'
ELSE 'Success'
END AS ResultDescription
FROM account_session
GROUP BY created on;
item_count

Please can any help on how to write conditonal expressions with the create column feature

Hi @watchnerd
You can use case function for Custom Columns:
https://www.metabase.com/learn/building-analytics/notebook-editor/custom-expressions.html
case([item_count] < 1, "Failure", "Success")

1 Like

@flamber amazing! thanks for the quick response! Loving my experience so far