Infinity datasource: UQL with global variable and string manipulation

  • What Grafana version and what operating system are you using?- “9.4.7”,

  • What are you trying to achieve?
    Dashboard filtering of pannels based on global variable

  • How are you trying to achieve it?

  • What happened?

  • What did you expect to happen?
    I have a dashboard variable
    $Branch and values are like 613, 00019, 671, 08023

I have 2 panels with columns
branch, jobname, status
In 1 pannel my infinity datasource data is fetched like
0001-9 , name, status
another pannel data fetched is
00019, name, status

My UQL is
parse-json
project “Job Name”, “branch”=split(“Job Name”,‘.’), “Status”
|mv-expand “branch”

|where “branch” in (${Branch:singlequote})

if I use
|where “branch” in (${Branch:singlequote})
then the pannel where data comes with - is not fetched.

How to manipulate the UQL so that when I pass 00019 variable, both these va;ues are fertched
0001-9 , name, status in pannel 1
and 00019, name, status in pannel 2.

Formatting by using value mapping is also not helping. I need something where the formatting is done before the query execution happens.

What can I use in UQL to remove /add the special character -
Any pointers would be highly appreciated

Please provide sample json data coming from your API. if you have data that cannot be shared publicly then obfuscate the data but keep data structure and post back