# Aggregating two \`count\` metrics

**URL:** https://discuss.elastic.co/t/aggregating-two-count-metrics/229359
**Category:** Kibana
**Created:** [April 22, 2020, 10:13pm UTC](https://discuss.elastic.co/t/aggregating-two-count-metrics/229359 "2020-04-22T22:13:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![code4dc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/code4dc/32/66923_2.png) [@code4dc](https://discuss.elastic.co/u/code4dc)
#### Post date: [April 22, 2020, 10:13pm UTC](https://discuss.elastic.co/t/aggregating-two-count-metrics/229359/1 "2020-04-22T22:13:18Z")

</div>

I have two metrics pulled in from GitHub Pull Requests: `# of Pull Requests` (total document count) and the `# of unique contributors` (based on user\_uuid).

I need to create a Metric where the first number is divided by the second number: `#PRs/#Contributors`

I've been racking my brain trying to figure this out. I tried creating a scripted field but I don't know how to get the # of documents from inside the script. I see Scripted Metrics Aggregation in the ES documentation but I am not sure how it can be visualized in Kibana.

I am using Kibana 6.8.6

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [April 22, 2020, 10:25pm UTC](https://discuss.elastic.co/t/aggregating-two-count-metrics/229359/2 "2020-04-22T22:25:32Z")

</div>

Hi, welcome! This is a common request, but not currently supported: [https://github.com/elastic/kibana/issues/4707](https://github.com/elastic/kibana/issues/4707)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 20, 2020, 10:25pm UTC](https://discuss.elastic.co/t/aggregating-two-count-metrics/229359/3 "2020-05-20T22:25:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
