Create column based on other column conditions (case statement in sql)

Hi, is it possible to create meta column based on the condition of other columns?
e.g:

+-----------------+
| Money.          |
+-----------------+
| 200             | 
|  3000           | 
|  50             | 
|  250            | 
+-----------------+

To be:

+-----------------+-----------------+
| Money.          | Category        |
+-----------------+-----------------+
| 200             |  100-1000       |
|  3000           | Above 1000      |
|  50             | Below 100       |
|  250            | 100-1000        |
+-----------------+-----------------+

Hi @amethyst
Yes, with Custom Column: https://www.metabase.com/learn/building-analytics/notebook-editor/custom-expressions.html
Something like this:
case([Money] < 100, "Below 100", [Money] < 1000, "100-1000", "Above 1000")

1 Like

I’m sorry but when I use a condition like this Metabase wouldn’t allow me to. The nilai_pendanaan column is monetary column.

@amethyst You have to write case(... like so:
case([nilai_pendanaan] < 100, "Below 100", [nilai_pendanaan] < 1000, "100-1000", "Above 1000")

1 Like

Great! Thank you.