tableau_newbie
tableau_newbie

Reputation: 3

Rolling sum with relative dates tableau

I have a formula: WINDOW_SUM( SUM( [gross_charge_amount] ), -7, 0)

This gives me the rolling sum for the last 7 days and sits on my row.

My column is the date field, I have used relative filtering to return the previous 60 days.

The issue is that the rolling sum starts from scratch instead of rolling on from the days > 60 day period.

One temporary fix that I have is that I double clicked on the x-axis and gave it a fixed start range. This doesn't encounter the problem of the graph cutting off.

How can I get the graph to show only the previous 60 days, but roll on continuously from before that 60 day?

Thanks

Upvotes: 0

Views: 514

Answers (1)

Bernardo
Bernardo

Reputation: 3318

Instead of a relative date filter, use FIRST() or LAST() or INDEX() as your filter to hide previous periods. This will allow the window sum to have started at the beginning of the data set but the filter will only show what you decide.

Upvotes: 1

Related Questions