I just wanted to check if there is a Left function or something similar that we can use in order to 'truncate' a string? (i.e. we would find very useful to only use the first 3 letters of a postcode to group certain accounts, orders etc.)
I couldn't find a way with the usual SQL functions through Metabase.
@ff9991 But "accountId" is an integer column - the function expects a string (hence the name substring) so you would need to do something like this: substring("accountId"::text, 0, 3)::integer as "accountId_test"
@ff9991
This has nothing to do with Metabase - the SQL is sent directly to Postgres, which gives the error.
Metabase has Custom Expressions in the GUI, which will (try to) not list incompatible column types for certain functions if there's a mismatch between the types.
Yes yes, I was referring to the fact that other BI tools have these in-built functions / Custom Expressions and there's no need to specify the data type, so I got a bit lost initially.