Timestream: Make FROM clause depend on IF or CASE Statement

0

Hey there,

I'm working with a Grafana Dashboard querying Timestream Data and I am looking for a solution to do the following:

SELECT temperature
FROM 
if(${my_variable} = '1', "my-database"."my-table", "my-database-derived"."my-table-derived")

${my_variable} results from a variable in my dashboard. Dependent on that value, I want to request the data from either the regular database or the derived one.

How can I make that work?

Thank you for any help!

nico
asked 6 months ago99 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions