So perfect now I know I can use multiple value for tag_selection. Unfortunately I am not able to use them after that even in a basic text panel (I want timeseries at the end but I’m first trying to make it work in Text panel).
According to the preview of the variable I should have for Tag_selection a second tag PROPULSION_STBD_MOTOR_POWER, and I don’t understand why it’s not the case…
This looks like a Grafana regression with multi value chained variables.
Your tag_selection query is already correct:
sql
SELECT tag_name
FROM tag_name_and_alias
WHERE alias IN (${alias:sqlstring})
The fact that the variable preview contains both tag values confirms that the query is returning both options. The problem is that when the dependent tag_selection variable is used in the panel, only one value is being interpolated.
This matches Grafana issue #130511, where a multi value parent variable and multi value chained variable result in only one value being passed to the linked variable:
So changing IN/= or the PostgreSQL query is not the fix here → your variable query is already using the correct syntax.
For a PostgreSQL panel, the normal syntax for the multi-value variable would be:
sql
WHERE tag_name IN ($tag_selection)
but if $tag_selection itself is losing the second selected value, that query cannot fix the underlying problem.
The key thing to check is how the multi-value variable is being interpolated. Grafana may return multiple values as a formatted string rather than exposing them as separate values in a Text panel. Try ${tag_selection:csv} or ${tag_selection:pipe} depending on how you need to use the values. For the Time series query, the correct format can also depend on the data source. If the variable preview shows both values, the variable itself is likely working and the issue is the interpolation/query syntax.