# Count No of occurrences of a tag

**URL:** <https://community.influxdata.com/t/count-no-of-occurrences-of-a-tag/18545>\
**Category:** InfluxDB 2\
**Tags:** grafana\
**Created:** [February 24, 2021, 11:07am UTC](https://community.influxdata.com/t/count-no-of-occurrences-of-a-tag/18545 "2021-02-24T11:07:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudeepvd](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sudeepvd](https://community.influxdata.com/u/sudeepvd)\
**Post date:** [February 24, 2021, 11:07am UTC](https://community.influxdata.com/t/count-no-of-occurrences-of-a-tag/18545/1 "2021-02-24T11:07:03Z")

</div>

How to count the number of occurrences of a tag (OS in my series) in influxdB?  
My result should be tag\_name, count

| OS | Count |
| --- | --- |
| Windows | 3 |
| Linux | 4 |

I need to finally draw a pi in grafana with the query…The pie should depict the no of users per OS.
