Aligning aggregateWindow

I have a Grafana graph that is using two Flux queries that return data produced by Telegraf, aggregating it using aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false).

The problem I am running into is the following: While I get windows with the proper interval, the windows are not aligned.

Basically, I am getting this:

Time in s        0   2   10   12   20   22   30   32
Query A         10       11        12        13
Query B              1         2        3         4

When stacking these two, I dont get a nice graph going smoothly up from 10 up to 17, but a graph that looks like this:

Time in s        0   2   10   12   20   22   30   32
Graph           10   1   11    2   12   3    13   4

How can I time align the queries so that for both queries, the time slots used by aggregateWindow are the same?

Hello @cfra,
Can you share your queries?
Thank you.
You can maybe use timeShift() function | Flux Documentation

But this shouldnt be happening unless soemthing weird is going on with your queries.