Sort by filed name for loki logs in grafana transformation not working for type string

I have field from loki logs message_duration with values as 3ms 5ms 422ms etc.
When I apply transformation on message_duration field sorting is not working.