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 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.

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

XNPV() returns the aggregated net present
value for a schedule of cashflows (not necessarily periodic) represented
by paired numbers in pmt and date, iterated over
a number of records as defined by a group by clause. Rate is the interest
rate per period. All payments are discounted based on a 365-day year.

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.