IRR- 圖表函數
IRR() 會針對圖表維度上反覆運算的數字 (以 value 指定的運算式表示) 所代表的一系列現金流量,傳回彙總的內部報酬率。
These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received for an investment consisting of payments (negative values) and income (positive values) that occur at regular periods. The function needs at least one positive and one negative value to calculate.
此函數使用 Newton 方法的簡化版本來計算內部報酬率 (IRR)。
語法:
IRR([TOTAL [<fld {,fld}>]] value)
傳回的資料類型: numeric
引數:
- value: 包含待測量資料的運算式或欄位。
-
TOTAL: 如果 TOTAL 這個字出現在函數引數之前,會計算已指定目前選項的所有可能值,而不僅是與目前維度值相關的值,也就是說,會忽略圖表維度。 TOTAL 限定詞後面可以加上以角括弧 <fld> 括住的一或多個欄位名稱。這些欄位名稱應該是圖表維度變數的子集。
TOTAL 限定詞後面可以加上以角括弧括住的一或多個欄位名稱清單。這些欄位名稱應該是圖表維度變數的子集。在這種情況下,將忽略所列圖表維度變數以外的所有圖表維度變數進行計算,也就是說,將對於所列維度欄位中欄位值的各個組合傳回一個值。另外,清單可以包含目前在圖表中並不是維度的欄位。對於維度欄位不固定的群組維度而言,這會相當實用。列出群組的所有變數會使得函數在向下探查層級變更時產生作用。
限制:
除非內部彙總包含 TOTAL 限定詞,否則彙總函數的參數不可包含其他彙總函數。 如需更進階的巢狀彙總,請使用進階函數 Aggr 結合指定的維度。
文字值、NULL 值和遺漏值將予以忽略。
範例與結果:
IRR(Payments): 0.1634.
The payments are assumed to be periodic in nature, for example monthly.
範例中使用的資料:
Cashflow:
LOAD 2013 as Year, * inline [
Date|Discount|Payments
2013-01-01|0.1|-10000
2013-03-01|0.1|3000
2013-10-30|0.1|4200
2014-02-01|0.2|6800
] (delimiter is '|');