Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Rsaiq
Creator
Creator

XIRR Calculations on the basis of Date Range

Hi All,

I have created a expression for calculating XIRR on the basis of date selections in the qliksense KPI,i used below expressions

=xirr(Sum({<Account={13405},[Date]={">=$(=Min({1} [Date]))<=$(=Min([Date]))"}>}Amount)
+ Cashflows + Sum({<Account={13405},[Date]={">=$(=Min({1} [Date]))<=$(=Max([Date]))"}>}Amount *-1),Date)

Above expression is not giving error but also its not giving output too.
In the expression summing 3 values

1.Sum({<Account={13405},[Date]={">=$(=Min({1} [Date]))<=$(=Min([Date]))"}>}Amount) (This calculation is for Calculating Opening)
        Here,Calculating the amount from start from the datasource to start date which is selected on date picker.Eg start is 06-06-2018 is in the datasource and
start date  01-06-2019 which is selected in the date picker and also have 1 condition i.e Account=13405.So,the amount is calculating from 06-06-2018 to 01-06-2019 with help of this expression.
2.Cashflow

        Its a column
3.Sum({<Account={13405},[Date]={">=$(=Min({1} [Date]))<=$(=Max([Date]))"}>}Amount *-1) (This calculation is for Calculating Closing)
         Here,Calculating the amount from start from datasource to start date which is selected on date picker.Eg start is 06-06-2018 in the datasource and
End date is 01-06-2021 which is selected in the date picker and also have 1 condition i.e Account=13405.So,the amount is calculating from 06-06-2018 to 01-06-2021 with help of this expression.

So,I have added all above 3 Calculations in 1st parameter of XIrr and added Date in second parameter.

From above XIRR Calculations, my output should be -7.6%(I have calculated this is in excel sheet)

Please find Attched XIRR Calculations exchel sheet (Opening & Closing is not available in datasource.So for this above Point 1 & Point 3 are used ).

Could anyone please help me to resolve this issue.

Thanks in advance

0 Replies