# Unique count per fieldA by FieldB and sum this total per fieldC + graphing

**URL:** <https://community.grafana.com/t/unique-count-per-fielda-by-fieldb-and-sum-this-total-per-fieldc-graphing/48629>\
**Category:** Grafana\
**Created:** [June 8, 2021, 11:54pm UTC](https://community.grafana.com/t/unique-count-per-fielda-by-fieldb-and-sum-this-total-per-fieldc-graphing/48629 "2021-06-08T23:54:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatman](https://avatars.discourse-cdn.com/v4/letter/h/f19dbf/32.png) [@hatman](https://community.grafana.com/u/hatman)\
**Post date:** [June 8, 2021, 11:54pm UTC](https://community.grafana.com/t/unique-count-per-fielda-by-fieldb-and-sum-this-total-per-fieldc-graphing/48629/1 "2021-06-08T23:54:30Z")

</div>

I want to do a unique count per fieldA(serialNumber) by FieldB(CommandID) and sum this total per fieldC(farmID).  
Which I can do in Kibana, but then I want to be able to collapse the rows to just show the FieldC(farmID) value.

the below picture might illustrate it better.

I have got the value in kibana(using visualisations) as the pic shows.  
Any idea how to collapse the rows?  
Or How would I be able to plt this value 92, over time at a per farm level in kibana or grafana

kibana pic

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/e/2/e2b9a7c1621072f394b4b5ba8fc95721634d7d37.png)

grafana pic

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/0/d0ccb23ae53c26e94ebf00a87e82028496d00d3f.png)

posted here also as is a kibana/grafana related topic.

> **[Unique count per fieldA by FieldB and sum this total per fieldC + graphing](https://discuss.elastic.co/t/unique-count-per-fielda-by-fieldb-and-sum-this-total-per-fieldc-graphing/275359)**
>
> I want to do a unique count per fieldA(serialNumber) by FieldB(CommandID) and sum this total per fieldC(farmID). Which I can do in Kibana, but then I want to be able to collapse the rows to just show the FieldC(farmID) value. the below picture...

- What Grafana version and what operating system are you using?  
7.5.7

- **What** are you trying to achieve?  
as above, grouping by, unique count by multiple fields

- **How** are you trying to achieve it?  
using kibana search and grafana transforms

- What happened?  
n/a

- What did you **expect** to happen?  
n/a

- Can you copy/paste the configuration(s) that you are having problems with?  
n/a

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.  
n/a

- Did you follow any online instructions? If so, what is the URL?  
no

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [June 8, 2022, 11:54pm UTC](https://community.grafana.com/t/unique-count-per-fielda-by-fieldb-and-sum-this-total-per-fieldc-graphing/48629/2 "2022-06-08T23:54:54Z")

</div>

Closed on June 8, 2022, 11:54pm UTC

This topic was automatically closed after 365 days. New replies are no longer allowed.
