What is CAGR?
Alex, CAGR is the Compound Annual Growth Rate. (http://www.investopedia.com/terms/c/cagr.asp#axzz1r5DUzolI)
I have attached a sample workbook using the data provided above. The calculation looks like the following:
((LOOKUP(sum([% Students]), last() )/LOOKUP(sum([% Students]), first() ))^(1/total((count(datepart('year', [Year]))))))-1
Once it is placed on the view, make sure to right click on it and select Compute Using-->Pane(Down).
Hope this helps!
CAGR.twbx.zip 29.0 KB
I believe that the formula is giving out a wrong result and should be
((LOOKUP(sum([% Students]), last() )/LOOKUP(sum([% Students]), first() ))^(1/total((count(datepart('year', [Year]))-1))))-1
There is one more '-1' to be added as the CAGR only looks at complete periods, and here there are only three (the 2007 datapoint marks the closing of 2007 and actually equals the opening one for 2008, and 2008, 2009 and 2010 are three complete periods.
In any case, I cannot get the formula to work in Tableau v8, it is always complaining about the second part of the formula, specifically the "datepart" portion. It says "datapart is being called with (string, string), did you mean (string, datetime)".
Does anyone please have some advice? Thanks!
Solved the issue: simple error, the date was formatted as string. Changing it per calculated field "date("12/31/"+str([Year_old]))", whereas Year_old was my original data.