Irr (PQL)
Given a list and a datapoint, calculates the discount rate at which the net present value (NPV) of cash flows equals zero on a constant set of time periods. Optionally accepts a ‘guess value’ and a ‘default value’ for when the IRR cannot be calculated.
- Returned Output: Numeric
- Library: PQL \ Semantic \ Financial
- Version: 2025.00.000
- Compatibility: Pyramid Query Language (PQL) data sources
Syntax
* Click on the function's arguments above for more details on the input values.
Comments
- The list needs to be a list or set of members. Typically, it's a set of dates. It is assumed that dates are equidistant from each other.
- The data point needs to describe values for each of the members in the list, typically its cash-flows (positive and negative).
- The first optional data point reflects a "guess" value to improve the calculator's performance.
- The second optional data point reflects the default value if no result can be determined.
- For details on how to employ and use this function see the semantic calculation overview.
Different Function types
- This function is like the Excel IRR function.
- Also see the XIRR function that assumes the dates are NOT equidistant from each other.
- There are other financial calculations in the Common library
Example
In this example, IRR is calculated from three dates with an initial investment of 2 and cash flows of 0.5 and 0.2:
Irr( {[Data].[Date].[1483228800000],[Data].[Date].[1483315200000],[Data].[Date].[1483401600000]}, -2, 0.5, 0.2 )