Skip to Content
avatar image
Former Member

12 Week Rolling Date Range

I've read through the links to previous question on this topic but none seem to answer my question. I have a BEx query that is returning Week/Calendar year as a string. I've created a variable called WeekToDate which, using the ToDate() function and RelativeDate() I've populated with a date which correlates to that Week/CalendarYear. What I'm stuck on now is how to return create the "moving" range that will only show 12 weeks worth of data starting with the current date. When we move into 2017 shortly, I will need to look back from 01/01/2017 (which is Week #1 for year 2017) and then look back to weeks 52,51,50,49, etc from year 2016. How do I define the 12 week moving range? The range below was created very simply with Week(CurrentDate()) and Week(CurrentDate()-11) defining the top and bottom of the range but I see that this will not hold up when we start to span a new year.

2ifoa.png (24.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers