Timefilter setting for data from 7 days ago - SQL Editor without Time shift

I would like help to create a panel containing a comparison between current order quantity x order quantity for seven days without using Time shift.
I’ve already tried $__timeFilter(created_at) BETWEEN CURRENT_DATE()-7 AND NOW() but without success.

You can use $__UnixEpochFrom and $__UnixEpochTo as variable in query to build your own filter.

…where TimeColumn > $__UnixEpochFrom - 604800 and TimeColumn < $__UnixEpochTo - 604800

Or:

…where TimeColumn + 604800 > $__UnixEpochFrom and TimeColumn + 604800 < $__UnixEpochTo

If you look at the documentation this should work.

Niels

@muschelpuster , thanks for the info!

Sorry for my ignorance, I don’t know how to handle “TimeColumn”
I tried as shown and as below but without success
I saw the documentation too but I couldn’t evolve

where created_at > $__UnixEpochFrom - 604800 and created_at < $__UnixEpochTo - 604800

I think you should set the time-column to name time:

SELECT $__timeGroupAlias(created_at,1m) AS time ...

You can also try to remove $__timeGroupAlias:

SELECT created_at AS time ...

Niels

@muschelpuster thanks for the info!
I haven’t had success yet
It’s hard to do this via query