# How to compile a dashboard with filter and nested jsons

**URL:** https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976
**Category:** Kibana
**Created:** [February 26, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976 "2019-02-26T10:39:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sunseaandpalms](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunseaandpalms/32/41327_2.png) [@sunseaandpalms](https://discuss.elastic.co/u/sunseaandpalms)
#### Post date: [February 26, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976/1 "2019-02-26T10:39:29Z")

</div>

Hello everyone,

I have an index with nested json and would like to build a dashboard with filters being applied to both parent and nested json. Kindly let me know if there is a way to accomplish that. Details below.

Below are the indices I have:  
{  
"id": 1,  
"collection": "Technical documentation",  
"document": "MyFirstDoc.txt",  
"checked": "2019-02-25",  
"status": "Valid"  
},  
{  
"id": 1,  
"collection": "Science Fiction",  
"document":"MySecondDoc.txt",  
"checked": "2019-02-26",  
"status": "Has problems",  
"problems": [  
{ "problem": "Spelling", "count": 100 },  
{ "problem": "Punctuation", "count": 15 },  
{ "problem": "Problem Y (the set of problems is not known beforehand)", "count": 3 }  
]  
},  
{ ... }

I need a following dashboard:

- A line chart plotting "status" (term) by "checked" (date) - **OK**
- A table with columns: "collection|problem|count" - **OK**
- A filter by "checked" (date) for both visualizations - **OK**
- A filter by "collection" (term) and "problem" (term) for both visualizations - **FAIL**

The goal is to manage to apply the filter to both views. The approaches I have in my mind:

- Use [Nested Objects](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html), [but they doesn't seem to be working](https://discuss.elastic.co/t/workaround-for-nested-objects/107108/4?u=sunseaandpalms)
- Flatten the structure, but first of all it doesn't make much sense since "problems" might be absent, second it is going to explode my data and data reload time might become an issue for me, and last but not least is that I will most likely require a [uniq count which might not be exact](https://www.elastic.co/guide/en/elasticsearch/guide/current/cardinality.html)
- Split into two documents - the way I do it today. I managed to apply the date filter to both views, but have issues with using same "collection" and "problem" filters for both views.
- Split into two dashboards - I don't see technical problems with that approach, but it violates the system requirements and I would like to leave it as a very last option.

Please let me know how would you solve the problem.

Thanks for everyone!

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [February 27, 2019, 6:53pm UTC](https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976/2 "2019-02-27T18:53:10Z")

</div>

Using nested JSON is notoriously difficult in Kibana (as you already said), so you will need a work-around.

imho, for now option 2, 'flatten the structure', is probably your best bet, as this is how most users index their data when they want to build dashboards with Kibana.

---

<div class="post-metadata">

### Author: ![sunseaandpalms](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunseaandpalms/32/41327_2.png) [@sunseaandpalms](https://discuss.elastic.co/u/sunseaandpalms)
#### Post date: [March 1, 2019, 8:20am UTC](https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976/3 "2019-03-01T08:20:20Z")

</div>

Thank you for response. Let me clarify one thing. If we proceed with denormalized approach, then it will most cause inaccuracies with Unique counts, eg. in case we need to calculate count of docs with errors by day

---

<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 29, 2019, 8:34am UTC](https://discuss.elastic.co/t/how-to-compile-a-dashboard-with-filter-and-nested-jsons/169976/4 "2019-03-29T08:34:38Z")

</div>

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