# Using filter by value transform on polystat panel with variables

**URL:** <https://community.grafana.com/t/using-filter-by-value-transform-on-polystat-panel-with-variables/67761>\
**Category:** Dashboards\
**Tags:** polystat, influxdb\
**Created:** [June 27, 2022, 3:31am UTC](https://community.grafana.com/t/using-filter-by-value-transform-on-polystat-panel-with-variables/67761 "2022-06-27T03:31:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![superknight](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@superknight](https://community.grafana.com/u/superknight)\
**Post date:** [June 27, 2022, 3:31am UTC](https://community.grafana.com/t/using-filter-by-value-transform-on-polystat-panel-with-variables/67761/1 "2022-06-27T03:31:18Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/6/f/6fb9fb53a76c1e2f3ed924039d14db48d33db66f.png)

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!

---

<div class="post-metadata">

**Author:** ![superknight](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@superknight](https://community.grafana.com/u/superknight)\
**Post date:** [July 16, 2022, 5:02pm UTC](https://community.grafana.com/t/using-filter-by-value-transform-on-polystat-panel-with-variables/67761/2 "2022-07-16T17:02:14Z")

</div>

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