# Compute a third metric in TimeLion from two existing metrics

**URL:** <https://discuss.elastic.co/t/compute-a-third-metric-in-timelion-from-two-existing-metrics/235644>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [June 3, 2020, 10:29pm UTC](https://discuss.elastic.co/t/compute-a-third-metric-in-timelion-from-two-existing-metrics/235644 "2020-06-03T22:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjaysubramanian](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sanjaysubramanian](https://discuss.elastic.co/u/sanjaysubramanian)\
**Post date:** [June 3, 2020, 10:29pm UTC](https://discuss.elastic.co/t/compute-a-third-metric-in-timelion-from-two-existing-metrics/235644/1 "2020-06-03T22:29:19Z")

</div>

Hi all

I am creating a TimeLion visualization in Kibana 7.7.0.  
My Timelion is as follows

```auto
.es(index=my_index_1,metric=cardinality:conversation_id,q=*,timefield=ts).label('NEW CONVERSATIONS'),
.es(index=my_index_2,metric=cardinality:conversation_id,q=*,timefield=ts).label('ALL_CONVERSATIONS')

```

Now I need a third graph that diplays a third metric  
Ration of new conversations to All Conversations  
(NEW CONVERSATIONS) / (ALL\_CONVERSATIONS)

How do I do that ?

Thanks

sanjay

---

<div class="post-metadata">

**Author:** ![sanjaysubramanian](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sanjaysubramanian](https://discuss.elastic.co/u/sanjaysubramanian)\
**Post date:** [June 4, 2020, 3:29pm UTC](https://discuss.elastic.co/t/compute-a-third-metric-in-timelion-from-two-existing-metrics/235644/2 "2020-06-04T15:29:01Z")

</div>

I think I may have figured it out

I added a third time series

.es(index=my\_index\_1,metric=cardinality:conversation\_id,q=_,timefield=ts)  
.multiply(10)  
.divide(  
.es(index=my\_index\_2,metric=cardinality:conversation\_id,q=_,timefield=ts)  
).label('PERCENTAGE')

---

<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:** [July 2, 2020, 3:29pm UTC](https://discuss.elastic.co/t/compute-a-third-metric-in-timelion-from-two-existing-metrics/235644/3 "2020-07-02T15:29:02Z")

</div>

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