Xnpv (PQL)
Given a list of DATES and a datapoint, calculates the net present value (NPV) of cash flows, over an uneven range of date periods.
- 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 from a date-time attribute. The dates do NOT need to be equidistant from each other.
- The first data point needs to describe values for each of the date-time members in the list, typically its cash-flows (positive and negative).
- The second data point should be the discount rate.
- For details on how to employ and use this function see the semantic calculation overview.
Different Function types
- This function is like the Excel XNPV function.
- Also see the NPV function that assumes the dates are equidistant from each other.
- There are other financial calculations in the Common library
Example
This example calculates the net present value of Sales on 2017-01-01 with a discount rate of 5%:
Xnpv( {[Data].[Date].[1483228800000],[Data].[Date].[1483315200000],[Data].[Date].[1483401600000]}, ([measures].[Data Sales]), 0.05 )