Using the Value of a Variable in the Name of Another Variable

I originally wanted to create a nested variable to use in a repeated panel, where the value of the variable would be based on the value of the first variable which the panel is repeated by, in order to add a second value for a single stat panel to display in the title.

example: SELECT column FROM table WHERE column2 = ‘$Variable1’

This, however didn’t work, as the value of the variable had to be set manually and could not change dynamically based on the first variables value in the repeated panel and selecting “All” would simply display “All” in the panels title.

To work around this a created one variable for each possible value of $variable1 and set this manually in the repeated value, which originally appeared to have worked. However after reloading the dashboard the manually configured Title field in each repeated panel has defaulted to the value of the first panel.

The title of each of the variables includes the value of $variable1 (example $q$variable1), however when trying to display these variables using the first variable it will simply show the value of the first variable instead of using it to define the second variable

$variable1 = W01
name of variable 2 = $qW01
Setting title as $qW01 displays “$qW01” rather than the value of variable $qW01

Is there any way to make this work without having to manually configure a panel for each possible value of variable1?