# Aggregation with unique count and sum: how to do it?

**URL:** <https://discuss.elastic.co/t/aggregation-with-unique-count-and-sum-how-to-do-it/234422>\
**Category:** Kibana\
**Created:** [May 26, 2020, 9:34pm UTC](https://discuss.elastic.co/t/aggregation-with-unique-count-and-sum-how-to-do-it/234422 "2020-05-26T21:34:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)\
**Post date:** [May 26, 2020, 11:16pm UTC](https://discuss.elastic.co/t/aggregation-with-unique-count-and-sum-how-to-do-it/234422/2 "2020-05-26T23:16:45Z")

</div>

Hey @simonlucalandi! I'm not 100% certain if Kibana can produce something exactly like that but I think we can get close...

Can you can create a terms aggregation on your `tx_id`? Just trying to follow along to this previous issue I found: [Sum of unique ids](https://discuss.elastic.co/t/sum-of-unique-ids/134065/5)

---

_[View the full topic](https://discuss.elastic.co/t/aggregation-with-unique-count-and-sum-how-to-do-it/234422)._
