1 Reply Latest reply on Jul 13, 2018 4:50 PM by Hari Ankem

How to write calculation to extract newest rolling 6 weeks data from Tableau

Hi Everyone,

I need to extract newest rolling 6 weeks data from Tableau.

Anyone can provide me some advice on the formula?

I have used this to extract the newest quarter to date data.....

IF [Fiscal Quarter]<={MAX([Fiscal Quarter])}

THEN [Sell Thru Dollars]

END

------------------------------------------------------------------------------------------------------

IF [Fiscal Week#(Quarter)]<={MAX(Fiscal Week#(Quarter)])} ( I don't know how to edit this part to be the sum of the most recent 6 weeks)

THEN [Sell Thru Dollars]

END

----------------------------------------------------------------------------------------------------------

All my week measures look like this:

• 1. Re: How to write calculation to extract newest rolling 6 weeks data from Tableau

You should use the date field and subtract 6 weeks from it. DATEADD("week",-6,[Date Field])

Then use this field to derive the other values as required.

1 of 1 people found this helpful