# Calculate nested objects

**URL:** <https://discuss.elastic.co/t/calculate-nested-objects/153046>\
**Category:** Kibana\
**Created:** [October 18, 2018, 4:38pm UTC](https://discuss.elastic.co/t/calculate-nested-objects/153046 "2018-10-18T16:38:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Kiechle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_kiechle/32/36682_2.png) [@Thomas\_Kiechle](https://discuss.elastic.co/u/Thomas_Kiechle)\
**Post date:** [October 18, 2018, 4:38pm UTC](https://discuss.elastic.co/t/calculate-nested-objects/153046/1 "2018-10-18T16:38:19Z")

</div>

Hello,  
I like to multiply the amount and price of products of an order an sum those. Is the VisualBuilder able to calculate such nested Objects?

# eg-calc:

amount: 1 \* price: 15.00 = 15.00  
amount: 2 \* price: 20.00 = 40.00

= 55.00

# eg-data:

`{ orderId: 123, products:[{ id:23, amount: 1, price: 1500}, { id: 45, amount: 2, price: 2000, }]}`

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [October 19, 2018, 4:40am UTC](https://discuss.elastic.co/t/calculate-nested-objects/153046/2 "2018-10-19T04:40:23Z")

</div>

Kibana doesn't have much support for [nested objects](https://www.elastic.co/guide/en/kibana/current/nested-objects.html). If the data is not actually a nested type, then you could create a scripted field to calculate the order total. Alternatively, it would be best to index the document with the order total.

---

<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:** [November 16, 2018, 4:55am UTC](https://discuss.elastic.co/t/calculate-nested-objects/153046/3 "2018-11-16T04:55:26Z")

</div>

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