I'm having a hard time understanding what the filter is for.
Here's a screenshot of year over year week comparisons. Let me know if this heading down the right path or if I'm way off point with the requirements.
(My data doesn't have current dates so applying the moving 1 year from current doesn't make sense but if you need help with that logic I can add it.)
That's a close viz and ultimately what I'm aiming for, but the time series weeks on the bottom (x-axis), while spanning 52-weeks, is a rolling period, where the most recent week's data is to the right and the least recent week's data (both aggregated) are to the left. So the time series is essentially constantly evolving.
So for example charting along the x-axis, your time series prior to turning over would be something like:
2013-28, 2013-29, 2013-30.....2014-25, 2014-26, 2014-27, with that entire time period covering 52 weeks
When the next week changes over (Week ends Sundays, starts Mondays), it would look something like this:
2013-29, 2013-30, 2013-31.....2014-26, 2014-27, 2014-28, with that entire time period still covering 52 weeks
In other words, at the turn of the new week, you drop the oldest week's worth of data covering the 52 week time period, and you add the most recent week's worth of data, starting right, ending left across the continuum (x-axis).
Would a filter like this work:
If you're concerned with leap year then some variation of the filter you proposed should work right?
No. I already have a filter that accounts for the data that I need, which I described in my original post.
The issue is when I use that filter I need to hide everything but the most recent 52 weeks grouping on my x-axis, but still use the data for year/year comparison by YearWeek.
Let me know if this is it:
This does a lookup of 52 weeks ago with a last() filter so that it shows only the last 52 weeks of data. Table calc filters only hide the data so the previous year isn't getting "filtered"
That definitely looks like it could be it! I will try it out based on your viz here, but any other tips you have would be great.
How did you approach your "Last Year's" calc?
Unfortunately my Tableau is not setup to view your attached workbooks. Just curious how you came up with the previous year calculation based on a measure, given that I need to keep the rolling time axis?
If you do a continuous Year week date field and then create a measure calc for last years week value:
lookup(sum([Sales]),-52) //compute using table across
You can stack the current weeks with last year's week by using measure names and measure values.
And then set the range of the "last()" filter to 0-51