Pass value from one panel to another panel query

Nothing changed - thru out my queries - by default I have time($_interval) & fill(null)

Still works fine - as long as I dont change that…

You were using 6h interval there. Could there some issue with data granularity? How is the data sampled? It’s probably daily, right? If that’s the case, I would set Min interval to 1d. And interval as well.

And since you’re displaying this in a table, you’re probably showing only last data point, so select Instant somewhere in the query options.

So, the data I have is since March - 2020 - so I am selecting - 1 Year as the time span and the counties data is just an overall number.

And - I can’t change anything in the Query option

If you want to have a yearly (=range) sum/mean/…, then you probably need something like time($__range) in the group by clause.

Everything works fine - regardless of the time interval…when I put the literal value…like ‘Alaska’ or something…

In the query - I see the value of the state_nm value…

Dont know - why I am not getting the rows…

Here is the raw data

Ok - I see a problem…

When I enter the literal value ‘Alaska’ the Query inspector shows this…

Now, when I am passin the variable - $state_nm - look at the query

Naw - both show 6h - so thats not the problem…

It has something to do with the range. When you click the link, it’s as if the dashboard reloaded, which means it either gets the time range from the link itself (from/to fields) or takes defaults or saved settings. You must now figure out which of these parameters changes when you click the link, so that you can then add this parameter to the link, to be maintained. That’s why you added from and to, but there may be something else. I told you to use from and to but perhaps you should use &${__url_time_range} instead of both of them. This one expands into something like &from=now-2d&to=now-1m instead of something like &from=1609716896260&to=1609720401879. I suspect this may be causing some difficulties with grouping then.

Alright - will explore and update…

Again - Thanks a bunch - pl. go and sleep now…

Catch you later…

TY - N

1 Like

Will update once I figure this out…

Its working!

So, after more research…

  1. There is no space in front of the value - I thoroughly checked in the DB
  2. $state_nm is capturing the click value and its being used in the Panel title
  3. I don’t if its Grafana or InfluxDB - for some reason - its adding a space in from of the value i.e., if the value in the DB is ‘Alabama’ - in the query its ’ Alabama’. So, what I did was in the query instead of ‘$state_nm’ - I added a space in front of the variable ’ $state_nm’ and it worked.

Thank you for all the help! - N

Fantastic! Judging by the content of this dashboard, I sincerely hope it becomes obsolete fast. But we both learned something new, which is good. I already used the approach on one of my dashboards, so thanks for bringing the issue up.