Hello, I would like to create a custom column but taken into account "natively" by Metabase, my sql query would be:
SELECT case when trim(substring(comment, 3,4)) = 'pcs' then substring(comment,1,2) else 1 end as NbPcs,*
where week >= 202235
order by id desc
How make that in metabase ? i try with Custom expressions but the expression "when / then" doesn't exist
To summarize, in my "comment" column I have three types of data and I want to retrieve a number which is the quantity:
Possible data type:
"7 pcs -" -> must become an integer of "7"
"GRAIN TROTTEMENT STRIPE" -> must become an integer of "1"
and nothing -> must become an integer of "1"
thanks in advance !