Data source is SQL Server, Grafana version 9.1.2.
I'm building a grafana dashboard for a range of metrics and aggregated data. A mixture of all sorts, lots of custom queries to the SQL Server database already.
However, if a particular field passes a certain threshold, then all the other data is irrelevant/should be ignored.
For background, I'm visualizing a manufacturing process, viewing field "w", "x", "y" and "z". The field "w" is a field representing the flow of material into the start of the process, so if "w" = 0 (or < than 10 for argument's sake), then values for x/y/z should be ignored, both in line graphs, and also in aggregations (I don't want my averages in bar graphs to be skewed by the incorrect input data).
I'm struggling a little to find the right way to search for how others may have done this before, my source data is all "long and thin" (time,value,metric) already, so pivoting out field "w" in every query is going to make query strings ugly, and cost compute on the SQL Server too (but this is possibly as a last resort).
Any help would be appreciated.