Using filter by value transform on polystat panel with variables

Hi all,

I am using Grafana v8.5.7 and my data source is InfluxDB. I am using a polystat panel to view certain parameters across a range of Assets, and group the results by that asset.

Example query that I have:
a) SELECT max(“value”) FROM “metric1” WHERE (AssetName) AND $timeFilter GROUP BY time($__interval), “AssetName” fill(null)
b) SELECT max(“value”) FROM “metric2” WHERE (AssetName) AND $timeFilter GROUP BY time($__interval), “AssetName” fill(null)

I would like to use a filter by value transform function on these results, so I only get the value from query A only when the value from query B = xyz. When doing this, I have to set up the transform conditions manually for each asset. Is there a way that I can avoid this?

I know as an alternative I can use a single stat panel, set up the filter by value transforms that I need and then repeat that panel/row for my variables.

Thanks!

Ended up figuring this one out. Could use the group by transform plus some other transforms to only show the desired result. Thanks