# Find gap between \_time

**URL:** <https://community.influxdata.com/t/find-gap-between-time/24585>\
**Category:** InfluxDB 2\
**Tags:** influxdb, query, flux\
**Created:** [April 8, 2022, 8:34pm UTC](https://community.influxdata.com/t/find-gap-between-time/24585 "2022-04-08T20:34:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoobi](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yoobi/32/9871_2.png) [@yoobi](https://community.influxdata.com/u/yoobi)\
**Post date:** [April 8, 2022, 8:34pm UTC](https://community.influxdata.com/t/find-gap-between-time/24585/1 "2022-04-08T20:34:49Z")

</div>

Hello, I’m new to Influxdb and store data as below

```auto
2022-04-08T11:00:00Z 2345.64
2022-04-08T11:01:00Z 2365.3
2022-04-08T11:02:00Z 2124.6
2022-04-08T11:03:00Z 2200.12
2022-04-08T11:04:00Z 2187.65
2022-04-08T11:08:00Z 2130.12
2022-04-08T11:10:00Z 2187.65

```

All my \_time are separate by one minute. I’d like to make a query to find the missing data, a result that could look like

```auto
2022-04-08T11:05:00Z
2022-04-08T11:06:00Z 
2022-04-08T11:07:00Z 
2022-04-08T11:09:00Z 

```

Do you know if it’s possible ? I’m using influxdb-client-java

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [April 8, 2022, 9:00pm UTC](https://community.influxdata.com/t/find-gap-between-time/24585/2 "2022-04-08T21:00:13Z")

</div>

@yoobi You could use `aggregateWindow()` to generate tables for each missing point. This should work if you set the `every` parameter to the same interval that your data should be coming in. You can then filter those results by rows for which a `_value` does not exist:

```javascript
data
    |> aggregateWindow(every: 1m, timeSrc: "_start", createEmpty: true)
    |> filter(fn: (r) => not exists r._value)

```

---

<div class="post-metadata">

**Author:** ![yoobi](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yoobi/32/9871_2.png) [@yoobi](https://community.influxdata.com/u/yoobi)\
**Post date:** [April 8, 2022, 10:41pm UTC](https://community.influxdata.com/t/find-gap-between-time/24585/3 "2022-04-08T22:41:01Z")

</div>

Thank you for your reply, unfortunately I can’t make it work, `aggregateWindow` is requiring a `fn`. I don’t know what to fill in ?

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [April 8, 2022, 10:51pm UTC](https://community.influxdata.com/t/find-gap-between-time/24585/4 "2022-04-08T22:51:54Z")

</div>

Oh, right. Sorry. Just use `last`.

```javascript
data
    |> aggregateWindow(every: 1m, fn: last, timeSrc: "_start", createEmpty: true)
    |> filter(fn: (r) => not exists r._value)

```
