# Normalized Histograms

**URL:** <https://discuss.elastic.co/t/normalized-histograms/211450>\
**Category:** Kibana\
**Created:** [December 11, 2019, 10:50am UTC](https://discuss.elastic.co/t/normalized-histograms/211450 "2019-12-11T10:50:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aravinda\_Kolla](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Aravinda\_Kolla](https://discuss.elastic.co/u/Aravinda_Kolla)\
**Post date:** [December 11, 2019, 10:50am UTC](https://discuss.elastic.co/t/normalized-histograms/211450/1 "2019-12-11T10:50:16Z")

</div>

Say you are plotting a bar plot of top n items occurring in index 'A'. Additional information about these items, such as length of the item, is present in index 'B'. Plot a normalized histogram of count/length.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [December 20, 2019, 1:07pm UTC](https://discuss.elastic.co/t/normalized-histograms/211450/2 "2019-12-20T13:07:54Z")

</div>

Hello,  
Can you give more details on how a document/item looks like in the index?

---

<div class="post-metadata">

**Author:** ![Aravinda\_Kolla](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Aravinda\_Kolla](https://discuss.elastic.co/u/Aravinda_Kolla)\
**Post date:** [January 14, 2020, 9:03am UTC](https://discuss.elastic.co/t/normalized-histograms/211450/3 "2020-01-14T09:03:19Z")

</div>

The document in index A looks as follows:

```auto
"id" : 100032,
"name": 'Abcssd',
"properties": ['g1','g2','g3','g4','g5']

```

The document in index B looks as follows:

```auto
"id" : 123,
"name": 'g1',
"length" : 10

```

I want a plot with `gi` on the x-axis and the `(count of docs in index A containing gi)/(length of gi)` on y-axis.

I know that joins are not possible in Elastic search, If this length information is sitting in an external database (postgres or a json file) , can it be accessed during the rendereing of the visualization?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 28, 2020, 11:56am UTC](https://discuss.elastic.co/t/normalized-histograms/211450/5 "2020-01-28T11:56:32Z")

</div>

This is not currently possible with the way the data works in Elasticsearch. You can just add a field in index A with the lenght of each property, in each document. With the way data is stored, it shouldn't increase the file size too much as it's redundant data.

---

<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:** [February 25, 2020, 11:56am UTC](https://discuss.elastic.co/t/normalized-histograms/211450/6 "2020-02-25T11:56:41Z")

</div>

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