Write a flux query range based on the week number

Hi! I am currently using flux and have a Grafana dashboard of acutals vs planned . the problem is currently I am using weeknumber as a variable in grafana and I am filtering out the planned table. for actuals i am using flux query where i have included boundaries.week function and the data for this week is queryed. The query i have now is

thisWeek = boundaries.week(start_sunday: true,)

startACTUAL = from(bucket: "production")
|> range(start: thisWeek.start, stop: thisWeek.stop)

From this I can only get this week’s visuals . if I have to nalyse the last weeks progress, I’ll have to change the code . So instead of doing that, I would like to use the week number ($week), which is a variable in the grafana dashboard to decide the range . for example if $week=21 then I would like my range to be week21.start and week21.stop.
Is there a way to do this?

Hello @tejaswy,
Have you tried using the date.week funciton?