# Using fields from parent in child visualisation

**URL:** <https://discuss.elastic.co/t/using-fields-from-parent-in-child-visualisation/137487>\
**Category:** Kibana\
**Created:** [June 26, 2018, 6:04pm UTC](https://discuss.elastic.co/t/using-fields-from-parent-in-child-visualisation/137487 "2018-06-26T18:04:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarolGorecki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolgorecki/32/32704_2.png) [@KarolGorecki](https://discuss.elastic.co/u/KarolGorecki)\
**Post date:** [June 26, 2018, 6:04pm UTC](https://discuss.elastic.co/t/using-fields-from-parent-in-child-visualisation/137487/1 "2018-06-26T18:04:28Z")

</div>

Hi,  
I have an index with parent - child join field and I want to create visualisation (e.g. a pie chart) with sum of child field and buckets base on field from parent. My Mapping looks like (this is an example not a real mapping)

> ```
> "document": {
> "properties" : {
> "name" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "document_join_field" : {
> "type" : "join",
> "eager_global_ordinals" : true,
> "relations" : {
> "document" : [
> "child_doc"
> ]
> }
> },
> "sum" : {
> "type" : "long"
> }
> }
> }
> 
> ```

So my question is - can i somehow use this join field to get to child or parent fields or should just flatten the mapping of my index?

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [June 26, 2018, 7:04pm UTC](https://discuss.elastic.co/t/using-fields-from-parent-in-child-visualisation/137487/2 "2018-06-26T19:04:32Z")

</div>

Kibana doesn't have support for this yet (you can follow [https://github.com/elastic/kibana/issues/3730](https://github.com/elastic/kibana/issues/3730)). Best route forward is to flatten for first class support 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:** [July 24, 2018, 7:04pm UTC](https://discuss.elastic.co/t/using-fields-from-parent-in-child-visualisation/137487/3 "2018-07-24T19:04:34Z")

</div>

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