# How we can use Math aggregation to access the value of series TSVB

**URL:** https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518
**Category:** Kibana
**Created:** [April 28, 2022, 1:28pm UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518 "2022-04-28T13:28:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sara\_sara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sara_sara/32/104998_2.png) [@sara\_sara](https://discuss.elastic.co/u/sara_sara)
#### Post date: [April 28, 2022, 1:28pm UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518/1 "2022-04-28T13:28:27Z")

</div>

Hey everyone,  
I want to perform one calculation using series value: state1 - state2, but I don't know how to do it 😓

 ![screen](https://us1.discourse-cdn.com/elastic/original/3X/3/0/30aed420f215d09e53bc7e133c67eda03019b60f.png)  
I need help please!!

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [April 28, 2022, 1:56pm UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518/2 "2022-04-28T13:56:10Z")

</div>

I would propose to use Lens formula if your kibana version support them. It will be easy.

1. Create a lens metric chart
2. Add as a metric a formula which will look like that:

```auto
count(kql='field : state1 ') - count(kql='field : state2')

```

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

---

<div class="post-metadata">

### Author: ![sara\_sara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sara_sara/32/104998_2.png) [@sara\_sara](https://discuss.elastic.co/u/sara_sara)
#### Post date: [April 28, 2022, 2:03pm UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518/3 "2022-04-28T14:03:55Z")

</div>

Unfortunately my version doesn't support this view , can I do this perform with TSVB ?

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [May 10, 2022, 8:34am UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518/4 "2022-05-10T08:34:15Z")

</div>

I am afraid you can't in TSVB.

---

<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: [June 7, 2022, 8:34am UTC](https://discuss.elastic.co/t/how-we-can-use-math-aggregation-to-access-the-value-of-series-tsvb/303518/5 "2022-06-07T08:34:47Z")

</div>

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