# I am making grafana dashboard using flux langauge. I need help in below tag queries

**URL:** <https://community.influxdata.com/t/i-am-making-grafana-dashboard-using-flux-langauge-i-need-help-in-below-tag-queries/24617>\
**Category:** Grafana\
**Tags:** flux\
**Created:** [April 12, 2022, 7:56am UTC](https://community.influxdata.com/t/i-am-making-grafana-dashboard-using-flux-langauge-i-need-help-in-below-tag-queries/24617 "2022-04-12T07:56:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sangeeta\_Agarwal](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sangeeta_agarwal/32/9845_2.png) [@Sangeeta\_Agarwal](https://community.influxdata.com/u/Sangeeta_Agarwal)\
**Post date:** [April 12, 2022, 7:56am UTC](https://community.influxdata.com/t/i-am-making-grafana-dashboard-using-flux-langauge-i-need-help-in-below-tag-queries/24617/1 "2022-04-12T07:56:05Z")

</div>

SHOW TAG VALUES FROM “jmeter” WITH KEY = “application”

SHOW TAG VALUES FROM “jmeter” WITH KEY = “transaction” WHERE “application” =~ /^$application$/ AND “transaction” != ‘internal’ AND “transaction” != ‘all’

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [April 12, 2022, 3:08pm UTC](https://community.influxdata.com/t/i-am-making-grafana-dashboard-using-flux-langauge-i-need-help-in-below-tag-queries/24617/2 "2022-04-12T15:08:13Z")

</div>

@Sangeeta_Agarwal The first query is pretty simple in Flux. There is a function specifically for this and it should be pretty quick depending on what version of InfluxDB you’re using. Because the 2nd query conditionally checks for tag values, it can’t use the same function. Here’s what the two queries would look like:

```javascript
import "schema"

schema.measurementTagValues(
    bucket: "example-bucket",
    measurement: "jmeter",
    tag: "application",
    start: -30d,
)

```

```javascript
import "regexp"

from(bucket: "example-bucket")
    |> range(start: -30d)
    |> filter(fn: (r) => r._measurement == "jmeter")
    |> filter(fn: (r) => exists r.transaction and r.transaction != "internal" and r.transaction != "all")
    |> filter(fn: (r) => r.application == regexp.compile(v: "^${application}$"))
    |> distinct(column: "transaction")

```

---

<div class="post-metadata">

**Author:** ![Sangeeta\_Agarwal](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sangeeta_agarwal/32/9845_2.png) [@Sangeeta\_Agarwal](https://community.influxdata.com/u/Sangeeta_Agarwal)\
**Post date:** [April 19, 2022, 6:11am UTC](https://community.influxdata.com/t/i-am-making-grafana-dashboard-using-flux-langauge-i-need-help-in-below-tag-queries/24617/3 "2022-04-19T06:11:06Z")

</div>

> [@scott](#):
>
> `|> distinct(column: "transaction")`

Thank you Scott.  
It worked :):
