Flux query does not return results if wider time range is selected

Hi,
We are facing some issue with influxdb flux query,
whenever we query the bucket and the time range selected is for example: past 7d
I get the query results, but when I select past 30d there is no result from query.
As past 7d query shows the data, this data should also be a part of the last 30d .
influxdb version: v2.7.1
The query that we used is :
import “influxdata/influxdb/schema”
from(bucket: “test”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“message_id”] == “msg_01”)
|> schema.fieldsAsCols()
|> yield()

Hello @FaizPatel,
Welcome!
Can you please share a screen shot of the output of the 7 day and the 30 day query please?
And any error messages?
You’re right that doesn’t make any sense.

Hi @Anaisdg , attached both query screenshots.


Hi @Anaisdg Any update ?

Hello @FaizPatel,
I apologize for the delay. I was out of office for the last week. I appreciate your patience.
Well that doesn’t make any sense does it. I can’t see anything that you’re doing wrong. Are you able to query for data without the fieldsAscols? Very strange behavior. I haven’t seen that before. Are you sure there isn’t a typo in your filters? I imagine you checked for that already (and are just changing the drop down), but that’s my best bet.
@scott have you ever seen something like this?

I haven’t seen this before. Something else I’d do just to rule it out is to update InfluxDB to the latest version (2.7.6). This is weird behavior. I’m curios, have you tried running these queries against the raw query API? If you do, you’ll need to replace the dashboard variable timestamps replaced with scalar time stamps.

1 Like