Splitting of concatenated value

Hi team,
Need information on how to split the value of variable on change of a variable and pass to the database view in grafana dashboard. Kindly suggest on this.

Ex:
Variable: ActiveTenants
Value inside variable: tenantname (shortform)
Value to be passed to view: shortform

Thanks and Regards
Aravinda

please post some sample mock data of what you are asking about?