Multiple Variable Interpolations

Hi,

I’m trying to interpolate a variable twice, e.g.:

$$Level → $($Level) → $State → Florida,
where Level = ‘State’ and State = ‘Florida’

example with a different Level:

$$Level → $($Level) → $County → Miami-Dade,
where Level = ‘County’ and County = ‘Miami-Dade’


This would be useful when using the Row-repeating functionality. I could repeat over ‘Levels’ and have each visualization (query + title) adapt which variables are being used based on the Level.

Does anyone know if something like this is possible? Thanks in advance.

1 Like

Hi Rob
In the dashboard settings, you may use a variable in the definition of a second variable e.g. to perform a query for the values of the second variable. Maybe you have to adjust the ‘Refresh’ setting of the variable.

Hi mdillier,

Thanks for the suggestion. I’m aware of this functionality, but I’m not sure how it will solve my problem.

Could you maybe provide a quick example which achieves the same thing as my example above?
That is, repeat a row over multiple values of a variable, while having the visualizations in each row adapt which variable they interpolate.

Hi Rob
I use the functionality in another way than you want it in your example. I have e.g. a variable ‘hostname’ with a text field, that can be set in the dashboard interactively with a hostname. Then this value is used in another variable, which queries some infos from the DB for this host. This second variable then is used in the dashboard to query the values that are visualized in a graph. It could be used to repeat panels too.
I think, you could use some similar approach, but it depends on the way, the values for the variables are set/queried in your example.

Hi mdillier,

I think the major distinction here is that I want to have a variable variable name i.e. after repeating panels, those values are used to refer to different grafana variables (corresponding to my different levels).

Since the repeating happens after the variable queries, I think it’s quite tough or impossible to have this influence a variable’s query. If I could just:

$$Level

Making dashboards with different levels of analysis in which similar visualizations are displayed for each level would so much easier…