How can i only show a part of metric name as alias name

i have created a variable of metrics from influxdb in grafana and i am using that variable inquery. I am using $measurement in alias by field so i am getting full name of metrics displayed. however i want to show only the id part of the metric name.

EG:the full metric name is “50hysupplyr.hysupplyaddtocartcategory.allRequests.all.max”
I want to display the name as “hysupplyaddtocartcategory”

Thanks in advance