What you're trying to achieve could be done
with Moving Window Table Calculation.
Please find the attached as an example.
Hope it could help.
Moving 30-day Sales.twbx 1.2 MB
Thanks, you answered nearly every question I had.
There is still 2 tricky points I would like to answer :
- if I have no profit for a day, and so no line in the profit table for that day, is there a way to handle this situation because the moving table calculation will find rows older than 30 days (if one day is missing, the window will then in fact be 31 days and not 30)
- an even more complex situation, where profits would not even be aggregated on a day but will stay at one line per contract with a time attribute (and so the number of lines per day is unknown). Is there a way to do this without aggregate the contract lines on the day.
1 of 1 people found this helpful
The answers could be quite simple:
-- If you have missing dates in your data,
you could set Show Missing Values flag to ON
on your Day([Your_Date]) Green Pill on Columns.
This would trigger a domain padding for Dates
(a special kind of data densification in Tableau),
so Tableau would draw Marks for every day --
even if there's no row for it in a datasource.
-- Your second point is not a problem whatsoever,
since your Measure (Profit or Sales in my example wb)
is aggregated on a view (as SUM([Sales]) ) anyway.
Hope this could help.
yeh it was quite simple indeed