# Create value on missing time series

**URL:** <https://discuss.elastic.co/t/create-value-on-missing-time-series/81794>\
**Category:** Elasticsearch\
**Created:** [April 10, 2017, 10:08am UTC](https://discuss.elastic.co/t/create-value-on-missing-time-series/81794 "2017-04-10T10:08:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![siam](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@siam](https://discuss.elastic.co/u/siam)\
**Post date:** [April 10, 2017, 10:08am UTC](https://discuss.elastic.co/t/create-value-on-missing-time-series/81794/1 "2017-04-10T10:08:00Z")

</div>

Hello everyone ;),

This my use case 🙂

Is it possible with elasticsearch to create missing value on a time series with a query ?  
For example, I have a series of data per hour with one value missing hour 5.

2017-04-10 00:00 584  
2017-04-10 01:00 410  
2017-04-10 02:00 988  
2017-04-10 03:00 488  
2017-04-10 04:00 19  
XXXXXXXXXXXXXXXXXXXXXXXX \<= this data not exist  
2017-04-10 06:00 85  
2017-04-10 07:00 564

for the hour 5, I would like repeat the last value or calculate the value with average of the X last values or others calculations for example.

thanks

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 10, 2017, 10:14am UTC](https://discuss.elastic.co/t/create-value-on-missing-time-series/81794/2 "2017-04-10T10:14:24Z")

</div>

Hey,

you have to come up with something like that yourself (using a date histogram aggregation to find empty buckets, and then create those artificial documents with whatever value you want them to be - the last point is exactly the reason why there is no such mechanism, everyone would need an own one anyway very likely).

--Alex

---

<div class="post-metadata">

**Author:** ![siam](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@siam](https://discuss.elastic.co/u/siam)\
**Post date:** [April 10, 2017, 10:23am UTC](https://discuss.elastic.co/t/create-value-on-missing-time-series/81794/3 "2017-04-10T10:23:59Z")

</div>

thanks

---

<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:** [May 8, 2017, 10:38am UTC](https://discuss.elastic.co/t/create-value-on-missing-time-series/81794/4 "2017-05-08T10:38:01Z")

</div>

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