# Data Normalization

**URL:** <https://discuss.elastic.co/t/data-normalization/258335>\
**Category:** Elasticsearch\
**Created:** [December 10, 2020, 9:07pm UTC](https://discuss.elastic.co/t/data-normalization/258335 "2020-12-10T21:07:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevezemlicka](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stevezemlicka](https://discuss.elastic.co/u/stevezemlicka)\
**Post date:** [December 10, 2020, 9:07pm UTC](https://discuss.elastic.co/t/data-normalization/258335/1 "2020-12-10T21:07:46Z")

</div>

We have a dataset with 110 million documents, 20 million of which have a reading of "0". We suspect some hourly readings have been lost due to totals running 10% to 30% lower than expected and unfortunately it seems they've been recorded as "0" instead of null.

One thought I had was to detect all "0" readings and then detect if the reading before and after are non-zero. If so, average them to replace the "0" reading. I'm ok either running an in-place replacement or outputting to another index.

Has anyone done something similar to this and if so, any tips or suggestions on how to accomplish this would be appreciated.

---

<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:** [January 7, 2021, 9:08pm UTC](https://discuss.elastic.co/t/data-normalization/258335/2 "2021-01-07T21:08:03Z")

</div>

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