# Trend chart with nested object

**URL:** <https://discuss.elastic.co/t/trend-chart-with-nested-object/168931>\
**Category:** Kibana\
**Created:** [February 19, 2019, 5:28am UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931 "2019-02-19T05:28:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssheldon](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@ssheldon](https://discuss.elastic.co/u/ssheldon)\
**Post date:** [February 19, 2019, 5:28am UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/1 "2019-02-19T05:28:45Z")

</div>

Hi,

I'm wondering if the following is possible without changing my Datamodel (using AWS ES so can't install custom versions either). Whenever I try to aggregate by a nested term I get no results, which I'm guessing is due to the lack of nested object support.

What I want is a line trend chart showing how the SelectedOptoinValues change for each one of these QuestionTitle's changes through time (each day) as surveys are entered. The data in ES looks like:

```
{
  "_index": "completedsurveys",
  "_type": "completedsurvey",
  "_id": "8",
  "_score": 1,
  "_source": {
    "id": 8,
    "questionResponses": [
      {
        "questionId": 1,
        "questionTitle": "ABC",
        "selectedOptionValue": 5,
      },
      {
        "questionId": 3,
        "questionTitle": "DEF",
        "selectedOptionValue": 2,
      },
      {
        "questionId": 4,
        "questionTitle": "GHI",
        "selectedOptionValue": 5,
      },
    ],
    "cultureCode": "en-US",
    "createdAt": "2019-02-19T05:01:27.695674Z"
  },
  "fields": {
    "createdAt": [
      "2019-02-19T05:01:27.695Z"
    ]
  }
}
```

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [February 20, 2019, 9:14pm UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/2 "2019-02-20T21:14:27Z")

</div>

Using objects inside of arrays in Kibana is not well supported. If you'd like to accomplish what you've mentioned, you might consider indexing your data in a different format (i.e. one document per response, still with the "id" field).

---

<div class="post-metadata">

**Author:** ![ssheldon](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@ssheldon](https://discuss.elastic.co/u/ssheldon)\
**Post date:** [February 21, 2019, 3:45am UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/3 "2019-02-21T03:45:49Z")

</div>

Can I do that just by creating a new index or do I need to change how the data is submitted?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [February 21, 2019, 10:47pm UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/4 "2019-02-21T22:47:23Z")

</div>

Sure, you could submit it to a separate index.

---

<div class="post-metadata">

**Author:** ![ssheldon](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@ssheldon](https://discuss.elastic.co/u/ssheldon)\
**Post date:** [February 22, 2019, 4:47pm UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/5 "2019-02-22T16:47:59Z")

</div>

Excuse my ignorance with Elastic, but what I'm really asking is, is there a way to just create a new index with the existing data in the cluster, or do I have to re-submit it all?

---

<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:** [March 22, 2019, 4:48pm UTC](https://discuss.elastic.co/t/trend-chart-with-nested-object/168931/6 "2019-03-22T16:48:02Z")

</div>

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