Can I use multiple windows in a single Kapacitor batch?

In the below example, I want to use a single batch but with multiple windows. How do I do this or if that’s possible even with “offset” and “shift” node.

var past = batch
|query(’’‘
SELECT…
’’’)
.groupBy(groups)
.period(w2w_period)
.every(w2w_every)
.offset(w2w_previous)
.align()
|shift(w2w_previous)
|mean(‘sum’)
.as(‘mean’)

var current = batch
|query(’’‘
SELECT …
’’’)
.groupBy(groups)
.period(period)
.every(every)
.align()
|mean(‘sum’)
.as(‘mean’)

You example looks good with the exception that you want the every value for both queries to match if you are joining the data.

What part isn’t working for you?