How to transform a case when expression into the Metabase native query

I am having troubles transforming the Druid SQL query into the Metabase native query.

This is my SQL code


This is a companion discussion topic for the original entry at https://stackoverflow.com/questions/73877832/how-to-transform-a-case-when-expression-into-the-metabase-native-query