Hopefully one of the Jedi Knights will see this post and provide some insight.
Maybe I dont need Table Calcs at all but trying to avoid having to do the sums in SQL.
After reading another POST to do with Average Weekday counts ( http://community.tableau.com/message/184951#184951)
I saw a Table Calc in there by Jonathan Drummey and thought it might help me....looks like it did.
Averaging Calculation: (Used it for all the values needed to create the final Lifetime Value - Just changing the WINDOW_AVG line to suit)
IF FIRST()==0 THEN
WINDOW_AVG(DATEDIFF('month',MIN([Order Date]),MAX([Order Date])), 0, (IIF(FIRST()==0,LAST(),0)))
I have attached the Workbook so anyone can have a look at how to calculate Customer Lifetime Value across all customers. I left the initial failed attempts in the workbook so you can see my progress towards the solution.
I am sure there are better ways to achieve the results, but this will do for now.
Average Lifetime - Solved.twbx.zip 474.1 KB
@Steven - That looks like what I would have done, nice work! Also as an FYI, the ,0, (IIF(FIRST()==0,LAST,0)) optimization is no longer needed in Tableau v8.
@Shawn - For table calcs, Joshua Milligan, Jim Wahl, and Brad Llewellyn have all been demonstrating some good stuff lately.
Thanks Jonathan. Appreciate it and the tip for v8.