Custom expressions: cast number to string

I have the following custom column expression: concat(floor([Duration, days] / 91) * 3, ".."). I want to get duration grouped per 3 months and show “0…2”, “3…5” etc. (I’ve omitted the bit after “…” for now). However, it gives me the following error message:

Value does not match schema: {:query {:expressions {:Duration, mnth. (named [nil (named (named (not (some-matching-condition? a-clojure.lang.PersistentVector)) "Must be a valid instance of one of these clauses: :field-id, :field-literal, :joined-field, :fk->, :datetime-field, :expression, :binning-strategy") "a") nil] "Must be a valid instance of one of these clauses: :substring, :trim, :ltrim, :rtrim, :replace, :lower, :upper, :concat, :regex-match-first, :coalesce")}}}

I suppose, there is no casting from number to string?

Hi @andreychirikba
Create two expressions - one for the math part, and one for the concat, where you use the first expression in the concat.
https://github.com/metabase/metabase/issues/12938 - upvote by clicking :+1: on the first post

Hi!
I am using version 0.49.7 and I tried following the suggestions in the issue. I also tried creating custom columns with just the number, then concatenating those custom columns with strings.
However, the solutions I've found keep giving me an error saying that concatenation can only be done with strings. Is there another way to concatenate integers with strings? ~

Thank you in advance!

I can't produce this error with our Sample database. What DB are you using? Can you share your question setup?

Hi, thank you for your answer!

I'm using a MongoDB Database.

Thats what I did:

And then I try to concat those two columns like suggested:

But the error keeps coming (I even tried to did it separately, but same error appear ):