Hi Eric - you were headed down the right path with window_max - the key is specifying what the window is! Check out the attached workbook to see an example. I've taken the simplest approach of putting each metric on its own sheet - you can form a table using containers on a dashboard.
WINDOW_MAX(SUM([Sales]),-51,0) is the key calc
Because I've placed week of order date on columns, I want to return the max sum(sales) over the previous 51 values, plus the current value.
The second calc returns any dates that have a sum(sales) value matching our calc from above (date should populate for every week where a 'change' occurred and there was a new max. Then the running max returns the most recent instance.
RUNNING_MAX(if SUM([Sales]) = [Calculation1] then attr(DATETRUNC('week', [Order Date])) END)
The final calc is the table calc LAST() - we put this on the filter shelf and set it equal to 0 so that we only get the column of data for the current week
Rolling Max.twbx 1.1 MB
Hi Andrew! Thanks for the reply. I am running Tableau 10.1 and cannot seem to open your twbx. Any chance to reupload another copy of it? Thanks!
I cannot seem to figure this problem out. Any form of advise of tip would be very much appreciated.
I have attached a workbook for better clarity at the spreadsheet i am trying to build. Thanks.