How to get a boolean result from timer data?

I have a lot of timer data in influxdb which I can chart beautifully in Grafana.

The issue is that I want to get a Yes / No result on a chart based on the values of the data.
Here’s the scenario:
I want to find whether or not a specific timer was over 30 seconds and chart the result so I can see how often at least one timer was over 30 seconds in each timeslot on the chart.

I can already get the count of times something is longer than 30 seconds, but charting that isn’t very helpful because I’m trying to find if these longer running processes are related, and some of them have hundreds of data points while the others only have a handful, so the scale of the chart makes it very difficult to read.

I just want to be able to have a 1 if a specific query returns any result, and a 0 if it doesn’t, and I don’t know how to achieve that?

Don’t quote me on this, IANAE. But I think a lot of these conversions are done on the frontend, in Javascript. If you use the value to text mapping, you might be able to set values >0 to “1”, and value=0 to “” (empty string). When Grafana goes to chart text, it will most likely cast the strings back to numbers, and an empty string will cast to zero.

The value to text mapping is just available on the SingleStat panel as far as I can tell.
I need to look at 2 different series of data and see if there is activity in one, is there also activity in the other during the same timeframe.

Therefore, I need to use a chart to see these trends over time.
I hope that is clearer.

Potentially you could do something like this https://grafana.com/blog/2019/07/17/ask-us-anything-how-to-alias-dashboard-variables-in-grafana-in-sql/. This reference also has some information that might be useful https://grafana.com/docs/grafana/latest/reference/templating/