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

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

kiban pic

grafana pic(noter value is 93 it should be 92)

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

You could choose to split by table on the farmID field, rather than splitting by row. That would collapse the farm ID column by showing a separate table per farm ID.

The other option is to just make a separate data table visualization that splits the rows on the farmID only. You could create a dashboard that shows both tables on one screen.

1 Like

tks, have tried that but not sure I follow, as I have to count uniquely on ther serial number and then take that value per command id and add that up. that comes to 92. 93 is wrong as that includes a duplicates for serial number. I want farmId,92, without all the other noise, if that makes sense.

think I get that now. tks

But what I want is to collapse per farm like this, so that is 1 row per farm with its associated values.