SAP Knowledge Base Article - Public

2294925 - How to use XIRR function with groups in Crystal Reports 2013

Symptom

  • You want to calculate Internal Rate of Return in a report for each group separately

Environment

  • SAP Crystal Reports 2013

Resolution

  1. Create a report with at least 2 fields (values and dates) and 2 groups
    XIRR1.jpg
  2. Set sorting by dates in ascending order (See KBA 2294933 for more information)
  3. Now you'll need to create 3 formulas
    1. Collect the records into 2 arrays (Values and Dates)
      XIRR7.jpg
    2. Do the calculation with the function
      XIRR6.jpg
    3. Reset the Arrays on group change (otherwise the values won't be correct in the later groups)
      XIRR5.jpg
  4. Place the 3 formulas to the correct sections, as below:
    XIRR3.jpg

Keywords

KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 2013