# Fill previous irregular data

**URL:** https://community.influxdata.com/t/fill-previous-irregular-data/15807
**Category:** Systems
**Tags:** influxdb, time-series, query, flux
**Created:** [September 1, 2020, 1:29pm UTC](https://community.influxdata.com/t/fill-previous-irregular-data/15807 "2020-09-01T13:29:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aamer](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aamer](https://community.influxdata.com/u/aamer)
#### Post date: [September 1, 2020, 1:29pm UTC](https://community.influxdata.com/t/fill-previous-irregular-data/15807/1 "2020-09-01T13:29:31Z")

</div>

Hello community,

Im dealing with irregular data, so i have a query (query\_1) that fill seconds where there is no value with previous. the query is working fine just the problem that if there is non previous it returns null.

\*\*\* query\_1 = “select mean(value) as mv from measure where time \> ‘2020-02-01T04:09:00Z’ and time \< ‘2020-02-01T04:16:00Z’ group by time(1s),tag\_id fill(previous)” \*\*\*

So to deal with null i have another query that returns the last value for each tag\_id

\*\*\* query\_last = “SELECT last(value) FROM measure WHERE time \< ‘2020-02-01T04:09:00Z’ group by tag\_id” \*\*\*

what i want in the end its to fill null values i get from the first query with value that i will get with the second query based on tag \_id as a commun tag.

Do you have any idea how to resolve that ? do you have any help

---

<div class="post-metadata">

### Author: ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)
#### Post date: [September 2, 2020, 7:31am UTC](https://community.influxdata.com/t/fill-previous-irregular-data/15807/2 "2020-09-02T07:31:46Z")

</div>

I simply think that’s not possible.

You could set a greater time interval in the grouping, in order to avoid too much filling and then set a static value for FILL, ie: `FILL(0)`
