# How to do Nested for Multiple objects arrays in Kibana to create the dashboards

**URL:** <https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709>\
**Category:** Kibana\
**Created:** [October 1, 2020, 3:15pm UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709 "2020-10-01T15:15:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabhu.292](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Prabhu.292](https://discuss.elastic.co/u/Prabhu.292)\
**Post date:** [October 1, 2020, 3:15pm UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709/1 "2020-10-01T15:15:29Z")

</div>

Hi All,

Below is the data set in kibana. My requirement is mentioned below for the kibana dashboards.

1. department wise male & female gender ratio  
2.department wise subject count  
3.department wise age group people

in my database for one lecturer we have multiple objects array so i need to do nested for all the department array to develop the dashboards.

\_Id  
Lecuturerid  
name  
phone  
dob  
gender  
department.0.id  
department.0.dob  
department.0.gender  
department.0.name  
department.0.subject  
department.1.id  
department.1.dob  
department.1.gender  
department.1.name  
department.1.subject  
department.2.id  
department.2.dob  
department.2.gender  
department.2.name  
department.2.subject  
department.23.id  
department.3.dob  
department.23.gender  
department.23.name  
department.23.subject

How to do it in KIbana?

Regards,  
Prabhu

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [October 1, 2020, 8:37pm UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709/2 "2020-10-01T20:37:32Z")

</div>

It sounds like you have documents that look like this:

```auto
{
  name: "Wylie",
  department: [
    { id: "asdf", name: "History" },
    { id: "qwer", name: "Philosophy" }
  ]
}

```

This is a valid document, but it is hard to analyze in Kibana. Can you change the way your documents are organized, by creating a single document that represents the data you want to index? For example, each department could have its own documents like:

```auto
{
  department_id: "asdf",
  department_subject_count: 5,
  department_gender_ratio: 0.2
}

```

Basically, I am recommending that you denormalize the data and calculate things before indexing. It sounds like you might be new to Elasticsearch, but you should read about the [limitations of arrays in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html).

---

<div class="post-metadata">

**Author:** ![Prabhu.292](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Prabhu.292](https://discuss.elastic.co/u/Prabhu.292)\
**Post date:** [October 2, 2020, 6:16am UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709/3 "2020-10-02T06:16:19Z")

</div>

Thanks for your quick response.

Actually in the kibana department I'd, department subject, department gender is coming multiple times as department 0,department 1,like wise it is going up to department 25.

Now how do I merge this column to create the dashboards for like department wise how many male and female.

Now it is very hard to interpret the dataset as it is coming multiple arrays.

Please let me know where to merge this column to create the meaning dashboard

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [October 2, 2020, 6:01pm UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709/4 "2020-10-02T18:01:09Z")

</div>

Like I said in my previous comment, you should change the way the documents are stored in Elasticsearch to make them easier to analyze in Kibana.

---

<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:** [October 30, 2020, 6:01pm UTC](https://discuss.elastic.co/t/how-to-do-nested-for-multiple-objects-arrays-in-kibana-to-create-the-dashboards/250709/5 "2020-10-30T18:01:21Z")

</div>

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