# Vertical Barchart: Perform Subcalculations and aggregate them

**URL:** <https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720>\
**Category:** Kibana\
**Created:** [March 20, 2018, 9:55am UTC](https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720 "2018-03-20T09:55:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nEihTfool2](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nEihTfool2](https://discuss.elastic.co/u/nEihTfool2)\
**Post date:** [March 20, 2018, 9:55am UTC](https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720/1 "2018-03-20T09:55:29Z")

</div>

Hello,

I have a data set of orders which look like this:

Customer; Bought Item; Price (of Item); Revenue of Basket; BasketID; Date of Purchase

And I want to display in a vertical barchart, how many customers are in specific group. There are 6 groups, classified, regarding the revenue, like this:

Group 1: 0€ to 100€  
Group 2: 100€ to 1000€  
Group 3: 1000€ to 10000€  
...  
and and so on up to group 6: 1000000€ to 10000000€

A simple range aggregation with Uniqe Count metrics came in mind. But the problem is that I need the sum of the revenues, in the selected timeframe.

E.g., if I want to look up the groups from 2016 to 2017, then I have to sum all basket revenues (or item prices) each customer purchased in this year.

Is this possible in Kibana?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [March 20, 2018, 11:52am UTC](https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720/2 "2018-03-20T11:52:43Z")

</div>

Hi,

I am sorry, this is not possible. What you would require is building ranges on top of a metrics aggregation. Elasticsearch unfortunately doesn't support any "Bucket Pipeline aggregation".

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![nEihTfool2](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nEihTfool2](https://discuss.elastic.co/u/nEihTfool2)\
**Post date:** [March 20, 2018, 12:07pm UTC](https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720/3 "2018-03-20T12:07:05Z")

</div>

Hi timroes,

thanks a lot for quick the response! It seems like that I have to prepare the data locally then.

---

<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:** [April 17, 2018, 12:07pm UTC](https://discuss.elastic.co/t/vertical-barchart-perform-subcalculations-and-aggregate-them/124720/4 "2018-04-17T12:07:08Z")

</div>

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