# Difference between "params.\<name\>" and "params.\_all.\<name\>.values" in TSVB Math aggregation

**URL:** <https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884>\
**Category:** Kibana\
**Created:** [May 10, 2020, 11:53am UTC](https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884 "2020-05-10T11:53:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tshayan](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tshayan](https://discuss.elastic.co/u/tshayan)\
**Post date:** [May 10, 2020, 11:53am UTC](https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884/1 "2020-05-10T11:53:18Z")

</div>

Hello,

Could someone please explain to me the difference between `params.<name>` and `params._all.<name>.values` in TSVB table visualization when using the Math aggregation? Based on the written definition I thought that `params.<name>` is a reference to the value in each bucket whereas `params._all.<name>.values` is an array made up of the values in all buckets.

For example if I have table of counts like this (split by sport type):

```
Sport, count
-------------------
soccer, 10
basketball, 5
football, 12

```

I'd expect `params.<name>` to return the specific value of each bucket (which it does) and `first(params._all.<name>.values)` to return "10" (first element in an array of [10, 5, 12]). Currently there is no difference between the two results as both return the count for each bucket. What am I missing?

My ultimate goal is to try and find a way to compare values between buckets... for example find and set all counts to the largest count `max(params._all.<name>.values)` and in this case all buckets should show 12. However, it doesn't seem to be possible.

Thanks.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 11, 2020, 5:12pm UTC](https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884/2 "2020-05-11T17:12:32Z")

</div>

Can you try using the script in a Bucket Script aggregation? I'm not sure the Math aggregation has access to all the buckets.

---

<div class="post-metadata">

**Author:** ![tshayan](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tshayan](https://discuss.elastic.co/u/tshayan)\
**Post date:** [May 11, 2020, 6:17pm UTC](https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884/3 "2020-05-11T18:17:33Z")

</div>

Is there a syntax to access the value of each individual bucket in Bucket Script? I am getting an error when using `params._all.var.values`:

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

---

<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 8, 2020, 6:17pm UTC](https://discuss.elastic.co/t/difference-between-params-name-and-params-all-name-values-in-tsvb-math-aggregation/231884/4 "2020-06-08T18:17:33Z")

</div>

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