I think we can do this a little more simply. I'd start by creating a calculated field like this:
N Weeks Back Dates
// Get the date going back N number of weeks.
IF [Order Date]>=DATEADD('week', -[Weeks Back], TODAY()) THEN
This doesn't care about the year or week number or anything like that. So it'll look something like this:
Is this what you're looking for?
if datetrunc('week',[Order Date]) < Datetrunc('week',Today())
datetrunc('week',[Order Date]) >= Dateadd('week',-[Weeks Back],Datetrunc('week',Today())) then
Yes, this was what I was looking for.
I used this
IF [Order Date]>= date(TODAY()-[Weeks Back]*7)
THEN 1 else 0