Max and Min value on text field

Hi,

Max and Min in the query editor is not allowed on text field only on numeric value.
Sometimes it could be usefull to be able to do a max / min on a text field.

Nicolas

Hi @nico8
But do you have columns with numeric data, which are a string type?
It is possible, if you create a Custom Column like [string_column] * 1, then you can use Max/Min functions on the column in filters and metrics.

Hi @flamber
No it is possible for the moment. My column is not a numeric data in a string type. It is a string.
I want to be able to do a Max / Min on a text column.
It is possible with SQL and we use it very often when using group by.
In the editor, min / max is possible only on a numeric value.
But maybe, for a standard user, it is right to restrict min / max on a text value.

@nico8 Okay, so you are looking for length function, which can then be combined with min/max?

Make a Custom Column with length([your_column]) and then make a Summarize Min/Max of that Custom Column.

No, it’s not length function. It is trick to display a string when using group by and agregate function like count, sum, …
Maybe it is specific in Oracle world. It will try to prepare an example.

Example with the Sample Dataset :

@nico8 Okay, I think I know what you’re getting at. That’s currently not supported. I’m 90% that the old hack of using Max([your_string_column]) used to work, but that doesn’t work on 0.35+
It’s very related to this issue about min/max on date/time fields:
https://github.com/metabase/metabase/issues/4482 - upvote by clicking :+1: on the first post