This section describes aggregation functions for financial operations regarding payments and cash flow.

Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.

Financial aggregation functions in the data load script

IRR() returns the aggregated internal
rate of return for a series of cash flows represented by the numbers in the
expression iterated over a number of records as defined by a group by
clause.

XIRR() returns the aggregated internal
rate of return for a schedule of cash flows (that is not necessarily periodic)
represented by paired numbers in pmt and date iterated
over a number of records as defined by a group by clause. All payments are discounted based on a 365-day year.

The NPV() script function takes a discount rate and multiple values ordered by period. Inflows (incomes) are positive, and outflows (future payments) are assumed to be negative values for these calculations. These occur at the end of each period.

The XNPV() script function takes specific dates corresponding to each cashflow being discounted apart from the discount rate. It is different from the NPV() function, since NPV() assumes all time periods to be equal. For this reason, XNPV() is more precise than NPV().

Financial aggregation functions in chart expressions

These financial aggregation functions can be used in charts.

IRR() returns the aggregated internal
rate of return for a series of cash flows represented by the numbers in the expression given by value iterated over the chart dimensions.

NPV() returns the aggregated net present value of an investment based on a discount_rate per period and a series of future
payments (negative values) and incomes (positive values,) represented by the numbers in value, iterated over the chart dimensions. The payments and incomes are assumed to occur at the end of each period.

XIRR()returns the aggregated internal
rate of return for a schedule of cash flows (that is not necessarily periodic) represented by paired numbers in the expressions given by pmt and date iterated
over the chart dimensions. All payments are discounted based on a 365-day year.

XNPV() returns the aggregated net present
value for a schedule of cash flows (not necessarily periodic) represented
by paired numbers in the expressions given by pmt
and date iterated over
the chart dimensions. All payments are discounted based on a 365-day year.