Duration literals - Influx 1.8

Hi,

Using Duration literals in Influxdb I would expect the week to start on a Sunday or maybe a Monday, seems it start on a Thursday for some resone, anyone have a solution for this?

image

For 1 week

SELECT sum(sensor1) FROM counts WHERE dev='counter1' AND $timeFilter GROUP BY time(1w) fill(none) tz('Europe/London')

For 2 weeks

SELECT sum(sensor1) FROM counts WHERE dev='counter1' AND $timeFilter GROUP BY time(2w) fill(none) tz('Europe/London')

For 30 days

SELECT sum(sensor1) FROM counts WHERE dev='counter1' AND $timeFilter GROUP BY time(2w) fill(none) tz('Europe/London')

Does this help?

1 Like

Thank you @grant2, needed to use the offset, as my data set only started on Thursday, so obviously Influx DB calculates it from then.

SELECT sum(sensor1) FROM counts WHERE dev='counter1' AND $timeFilter GROUP BY time(1w,3d) fill(none) tz('Europe/London')
1 Like