# Count nested elements

**URL:** <https://discuss.elastic.co/t/count-nested-elements/292652>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [December 22, 2021, 8:39am UTC](https://discuss.elastic.co/t/count-nested-elements/292652 "2021-12-22T08:39:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed.softparadigm](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mohamed.softparadigm](https://discuss.elastic.co/u/mohamed.softparadigm)\
**Post date:** [December 22, 2021, 8:39am UTC](https://discuss.elastic.co/t/count-nested-elements/292652/1 "2021-12-22T08:39:28Z")

</div>

I want to create a visualization which count the number of orders with orderStatus.code : confirmed.  
But the problem I faced is that orderStatus is nested field of order. Even with vega I didn't get the solution.  
Any suggestion?

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [December 22, 2021, 1:50pm UTC](https://discuss.elastic.co/t/count-nested-elements/292652/2 "2021-12-22T13:50:34Z")

</div>

If you can supply a sample data structure and the expected outcome I could take a look.

---

<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:** [January 19, 2022, 1:50pm UTC](https://discuss.elastic.co/t/count-nested-elements/292652/3 "2022-01-19T13:50:44Z")

</div>

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