# 财务聚合函数

本部分介绍财务运作中与付款和现金流相关的聚合函数。

使用每个函数的下拉列表可查看每个函数的简短描述和语法。单击语法描述中的函数名称可了解更多信息。

## 加载脚本中的财务聚合函数

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### IRR

IRR() 函数用于返回聚合内部回报率，以揭示迭代于 group by 子句定义的大量记录上的表达式的数值表示的现金流系列。

[**IRR**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/IRR.htm)(expression)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### XIRR

XIRR() 函数用于返回聚合内部回报率，以揭示迭代于 group by 子句定义的大量记录上的 pmt 和 date 表达式的成对数值表示的现金流明细表（不必为周期性的）。 所有付款全年折扣。

[**XIRR**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/XIRR.htm)(pmt, date)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### NPV

NPV() 用于根据迭代于 group by 子句定义的大量记录上的 value 的数值表示的一系列未来付款（负值）和收入（正值）以及每周期的常量 discount\_rate，返回投资聚合净现值。假设为在每个周期结束时发生的付款和收入。

[**NPV**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/NPV.htm)(discount\_rate, value)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### XNPV

XNPV() 函数用于返回聚合净现值，以揭示迭代于 group by 子句定义的大量记录上的 pmt 和 date 表达式的成对数值表示的现金流明细表（不必为周期性的）。比率为每周期的利率。 所有付款全年折扣。

[**XNPV**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/XNPV.htm)(discount\_rate, pmt, date)

## 图表表达式中的财务聚合函数

以下财务聚合函数可用于图表中。

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### IRR

IRR() 用于返回通过在图表维度上迭代的 value 指定表达式中数值表示的一系列现金流的聚合内部返回率。

[**irr**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/ChartFunctions/FinancialAggregationFunctionsInCharts/irr.htm)([TOTAL [&lt;fld {,fld}&gt;]] value)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### NPV

NPV() 用于根据每周期的 discount\_rate 和通过图表维度迭代 value 的数值表示的一系列未来付款（负值）和收入（正值）返回投资聚合净现值。假设为在每个周期结束时发生的付款和收入。

[**npv**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/ChartFunctions/FinancialAggregationFunctionsInCharts/npv.htm)([TOTAL [&lt;fld {,fld}&gt;]] discount\_rate, value)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### XIRR

XIRR() 用于返回通过图表维度迭代 pmt 和 date 指定表达式中成对数值表示的现金流时间表（即不一定是周期性的）。 所有付款全年折扣。

[**xirr**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/ChartFunctions/FinancialAggregationFunctionsInCharts/xirr.htm)([TOTAL [&lt;fld {,fld}&gt;]] pmt, date)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/FinancialAggregationFunctions/financial-aggregation-functions-script.htm)

#### XNPV

XNPV() 用于返回通过图表维度迭代 pmt 和 date 指定表达式中成对数值表示的现金流时间表（不一定是周期性）的聚合净现值。 所有付款全年折扣。

[**xnpv**](https://help.qlik.com/zh-CN/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/ChartFunctions/FinancialAggregationFunctionsInCharts/xnpv.htm)([TOTAL [&lt;fld{,fld}&gt;]] discount\_rate, pmt, date)