# Calculate ratio beetwin count and unique count

**URL:** <https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588>\
**Category:** Kibana\
**Created:** [January 17, 2022, 1:09pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588 "2022-01-17T13:09:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred59](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Fred59](https://discuss.elastic.co/u/Fred59)\
**Post date:** [January 17, 2022, 1:09pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/1 "2022-01-17T13:09:33Z")

</div>

Hello,

I have a list of tickets for a computeur support.  
I would have in a tab the ratio beetwin the count of exchange and the unique count of ticket number, for different typologies, like that:

![image](https://us1.discourse-cdn.com/elastic/original/3X/1/9/193967a3b789a5e0dd9445ff7289def3f7806d8e.png)

Is it possible in a tab ?

thanks

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 17, 2022, 1:29pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/2 "2022-01-17T13:29:07Z")

</div>

Hello,

I suppose this topic is related to you. Only with kibana seems impossible unfortunately, but transform may be a possible solution.

> [@Add a column based on a Bucket Script Aggregation or other columns into a Data Table visualization](https://discuss.elastic.co/t/add-a-column-based-on-a-bucket-script-aggregation-or-other-columns-into-a-data-table-visualization/229250):
>
> I am building a Data Table in which I could get two required columns but I need to add one additional column which is the difference between these two. Is that somehow possible? I could get the desired results using a Bucket Script Aggregation, but how can I use this in the Data Table? Please consider the following mock-up case for a better explanation. The case is for performance metrics recorded for different machine learning models per customer. We need to show a summary table of the averag…

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [January 17, 2022, 1:36pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/3 "2022-01-17T13:36:01Z")

</div>

Hi @Fred59 ,

another option you can consider is Lens formula:

```auto
unique_values( myField ) / count()

```

to know more about Lens Formulas you can have a look at the guide, which includes some nice examples: [Create visualizations with Lens | Kibana Guide [7.16] | Elastic](https://www.elastic.co/guide/en/kibana/current/lens.html#lens-formulas)

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 17, 2022, 1:45pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/4 "2022-01-17T13:45:54Z")

</div>

The option looks great. Thanks for adding that.

This is an example on kibana\_sample\_data\_flights.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/2/42b341daac57d6712e1ec2a2354d7699ff63d643.png)

---

<div class="post-metadata">

**Author:** ![Fred59](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Fred59](https://discuss.elastic.co/u/Fred59)\
**Post date:** [January 17, 2022, 1:50pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/6 "2022-01-17T13:50:07Z")

</div>

thanks but it's desable on my hoster ☹

---

<div class="post-metadata">

**Author:** ![Fred59](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Fred59](https://discuss.elastic.co/u/Fred59)\
**Post date:** [January 17, 2022, 1:50pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/7 "2022-01-17T13:50:35Z")

</div>

thanks but it's desable too on my hoster ☹

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [January 17, 2022, 1:51pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/8 "2022-01-17T13:51:13Z")

</div>

Which version of the stack do you have?

---

<div class="post-metadata">

**Author:** ![Fred59](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Fred59](https://discuss.elastic.co/u/Fred59)\
**Post date:** [January 17, 2022, 1:51pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/9 "2022-01-17T13:51:29Z")

</div>

I think i will use that:

> **[GitHub - fbaligand/kibana-enhanced-table: Kibana visualization like a Data...](https://github.com/fbaligand/kibana-enhanced-table)**
>
> Kibana visualization like a Data Table, but with enhanced features like computed columns, filter bar, and “Split Cols” bucket - GitHub - fbaligand/kibana-enhanced-table: Kibana visualization like a...

It should be possible to install that on my hoster 🙂

---

<div class="post-metadata">

**Author:** ![Fred59](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Fred59](https://discuss.elastic.co/u/Fred59)\
**Post date:** [January 17, 2022, 1:51pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/10 "2022-01-17T13:51:48Z")

</div>

Kibana 6.8.23

---

<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:** [February 14, 2022, 1:52pm UTC](https://discuss.elastic.co/t/calculate-ratio-beetwin-count-and-unique-count/294588/11 "2022-02-14T13:52:18Z")

</div>

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