Is this what your are looking for?
Here is what I did:
- Duplicated the data source
- Renamed the Date field in the secondary (copy) data source
- Created new Date field in the secondary data source equal to Original Date + 7
- Created blended view showing count from the primary data source (this week's count) and that from the secondary data source (last week's count)
- For the filter, I used a calculated field that looks for the maximum date in the view and shows the last 7 dates (based on the primary view). Alternatively, if you will have real time data, you can just use a regular filter on Date where Date >= toda() - 7. If you use my approach, you have to keep in mind that Tableau is retreiving all the dates and doing a filter after running the table calc. This can be slow depending on the amount of data. I would recommend you add a filter to limit the amount of data pulled from your back end data source as well.
Date Challenge - pm.twbx.zip 34.2 KB
Hi Pedro, great approach. As you mentioned, my first concern is the performance hit with a double data source connection and then a Tableau Blend on top of that. Although the Workbook will only have a small amount of data in it at any given time (less than 20K rows), my Dashboard has 9 different worksheets (requirements driven, not best practice driven). With that many worksheets, I'm concerned about the performance hit for the Dashboard. However, I'm implementing and I'll let you know how it goes, thanks.
Turns out Pedro NAILED IT! Thank you kind sir!
You're welcome. I'm glad it worked.