Multiple series from a single query

I’m trying to figure out how to make a single query that will draw multiple different series (where I can stack the lines or color each differently). I have an Amazon Timestream DB that has metrics (X, Y, Z) for individual units (ex. A, B and C). I want to plot a line for metric X on unit A over time, another line for metric X on unit B over time etc. I can easily do this with individual queries using the WHERE clause to limit the data to unit A. The problem is i don’t know how many units there are or which ones the user has selected to look at. That is driven by a multi-select query variable. I also do not want to repeat panels based on the multiselect variable. I want to see these lines plotted (or possibly stacked) in a single panel. Can someone point me in the right direction using Presto SQL? I feel like I need to somehow split the results based on the Unit in question.

Example Table
| 00:00 | A | 10 |
| 00:01 | B | 5 |
| 01:00 | A | 12 |
| 01:04 | B | 4 |
… etc …

Hello and welcome to the forums. What version are you using? This seems a known problem

Grafana version 7.4.3

1 Like

The Grafana Play site does exactly what i’m trying to do. Grafana

We are using a custom datasource plugin to connect with an Amazon Timestream DB. I didn’t build the data source plugin but i’m becoming suspicious it’s got something to do with how our queries (Raw SQL) are processed and returned using the Grafana data frames. The response in the query inspector on the Grafana Play site looks quite different from our own.

could you please upgrade to version 6 and test if this is working ?

1 Like

Hi Habib, we’re on version 7 already. But I think even before we get to whether it works on a specific version, I’m trying to figure out how to even query the data in a way that Grafana would interpret as separate series.

1 Like

no i mean do the sidegrade to version 6

Perhaps asking someone to “downgrade” would be more clear that you do mean
going from a higher version to a lower version.

I also use an older version of Grafana, simply because it doesn’t have some
problems that later versions do, it works with the browsers I have (later
versions don’t even display the query editor), and some little things such as
font sizes and panel spacings have been fiddled with, which means I like the
appearance I was used to, until the advantages of a later version mean that
I’m ready to upgrade and re-configure my JSON dashboard designs to fit nicely
onto an HD display once more.


This topic was automatically closed after 365 days. New replies are no longer allowed.