# Query $timeFilter and last before combined

**URL:** https://community.influxdata.com/t/query-timefilter-and-last-before-combined/17182
**Category:** Telegraf
**Tags:** influxdb, grafana
**Created:** [December 12, 2020, 2:24pm UTC](https://community.influxdata.com/t/query-timefilter-and-last-before-combined/17182 "2020-12-12T14:24:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chris\_quin](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@chris\_quin](https://community.influxdata.com/u/chris_quin)
#### Post date: [December 12, 2020, 2:24pm UTC](https://community.influxdata.com/t/query-timefilter-and-last-before-combined/17182/1 "2020-12-12T14:24:27Z")

</div>

As you can see in pic1 my graph starts at 6am because there is no data before in the requested interval. I want to fill data with the last datapoint before the interval (request like select last(…)…) so that grafana can fill with the previous. Is this possible?

 ![pic1](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/c/c1efdc6ed54bf70b3e0cbe491da4b2747648ca6a.png)  
[pic2|690x156](https://community.influxdata.com/uploads/short-url/76wB9NLFhKrm4FFZRGGJtFHiZ7r.png)

---

<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: [December 14, 2020, 8:58am UTC](https://community.influxdata.com/t/query-timefilter-and-last-before-combined/17182/2 "2020-12-14T08:58:39Z")

</div>

have a look at FILL()

> **[Data exploration using InfluxQL | InfluxDB OSS 1.7 Documentation](https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#group-by-time-intervals-and-fill)**
>
> Explore time series data using InfluxData’s SQL-like query language. Understand how to use the SELECT statement to query data from measurements, tags, and fields.

Even if in your case I don’t think that’s possible, you will probably use fill(previous) but for it to work the fill value must be present in the selected range, if the first value is null, there won’t be any value to use for filling gaps.

Also using fill(none) might be worth a try

---

<div class="post-metadata">

### Author: ![chris\_quin](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@chris\_quin](https://community.influxdata.com/u/chris_quin)
#### Post date: [December 14, 2020, 6:49pm UTC](https://community.influxdata.com/t/query-timefilter-and-last-before-combined/17182/3 "2020-12-14T18:49:44Z")

</div>

fill(previous) isn’t working like you mentioned: i don’t have a value in the selected range and i don’t know when the previous one is before (maybe 1h or even 1 week)
