
1. Re: Calculate moving sum of values, year to date
Wilson Po Sep 11, 2012 4:37 PM (in response to hub.yoo)1 of 1 people found this helpfulHi Hub,
Window_Sum can be used to sum up 365 days in your data set if the days are displayed out and consistent enough. For any moving calculation, I generally find it easier simply using the "add table calculation" dialog, but if you are looking for resources, the manual is really good on this subject matter and there's a video on the table calcs as well.
Video: http://www.tableausoftware.com/learn/tutorials/ondemand/tablecalculations
Hopes this helps!
Wilson

2. Re: Calculate moving sum of values, year to date
hub.yoo Sep 11, 2012 5:31 PM (in response to Wilson Po)Ah boo. I don't think it works with data because of the multiple date entries, variable number of lines....
I'm trying to sum up all the units ordered from a particular date to a year back. (If order date is 9/1/12, then the sum of all the sales from 9/1/11 to 9/1/12). can you recommend a different approach than the window_Sum()?
I'm trying to use if statements but it isnt allowed because i cant mix aggregate and non aggregate statements.
But thank you for the resources sir!

3. Re: Calculate moving sum of values, year to date
Wilson Po Sep 11, 2012 11:42 PM (in response to hub.yoo)Hi Hub,
Can you include a small sample table of what your data might look like? If there's challenges around uneven dates, there might be some solutions by using different date roll ups and having the window_sum restart appropriately. I suspect we can do it since Window_SUM were design specifically to handle moving sum calculations effectively.
Best,
Wilson

4. Re: Calculate moving sum of values, year to date
hub.yoo Sep 12, 2012 11:05 AM (in response to Wilson Po)Hello Wilson,
Thanks for the continued forum exchanges. I added a packaged workbook... tried using regular calculations but
"If attr(Dateadd('year',1, Order_Date)) < attr(Order_Date) then sum(Qty_Ordered) end"
doesn't work. I understand why it doesnt work. I just don't have any ideas around it.
Reading the lit though

5. Re: Calculate moving sum of values, year to date
hub.yoo Sep 12, 2012 3:32 PM (in response to hub.yoo)Oops sorry. I guess i cant use windows calculations. cant use windows calculations if there are no tables, right?
What i'm actually trying to do is graph the Xmonth period of sales over time. So for 8/1/12, that value would show the sum of sales from (Xmonths before order date) to the order date.
Does anyone have method to find the sum of values over a period of time? do i need an independed date period?
I need this to create an inventory turns dashboard, which is (sum of unit sales for 12 month period) / (sum inventory levels)

6. Re: Calculate moving sum of values, year to date
Eric Johnson Dec 12, 2012 7:36 PM (in response to hub.yoo)Is there still no solution to this issue? I need to chart monthly Trailing12 values.
Thanks