0

I am having a Grafana Dashboard with Grafana Viz(TimeSeries), When I select particular value in dropdown, stil its showing all values in Grafana Viz.

Grafana Viz SQL Query:

SELECT DATE, impliedVolatility_OPT AS "-",symbol  FROM <db>.<tl>

Grafana Variable(Drop Down SQL Query):

SELECT DISTINCT CONCAT('- ', symbol) AS symbol FROM <db>.<table_name>;

Snap Attached: enter image description here

Once inspect query in Grafana Viz, Apply Panel Transformation is able to select dataframe of sql query in Multi Frame Transformation

But Varible is not working when selected particular value in Variable.

enter image description here

2 Answers 2

1

You need to apply a filter in your visualization query for the selected value from the dropdown.

The options in the dropdown are prefixed with '-' and you have the symbol variable configured to include All option and multi-value.

You need to filter in a list of values as a result, you can write:

SELECT 
    DATE, impliedVolatility_OPT AS "-", symbol  
FROM <db>.<tl>
WHERE CONCAT('- ', symbol) IN (${symbol:singlequote})
Sign up to request clarification or add additional context in comments.

Comments

0

As in my SQL Table I don't have - added infront of symbols.

Now I changed the variables and Vizulization query as below and DropDown is working now.

Variable SQL Query for Dashboard:

SELECT DISTINCT  symbol FROM <db>.<tl>;

And VIZ Query:

SELECT DATE, 
symbol, impliedVolatility_OPT '-'
FROM <db>.<tl>
WHERE symbol IN ($Symbol)

SNap: enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.