IRR calculation in Knime

Hi! I’m trying to find out is there any way to calculate periodical IRR’s with Knime?

Quick explanation: With periodical I mean I have a set of transactions, that have multiple portfolio companies in the transactions. Each row has the following data: company, date, and value of the transaction. What I would like to do, is to calculate the IRR for every quarter from the date the first transaction has occurred for that specific company. Is there any way to accomplish this?

Thanks :pray:

Hi @Data_consumer ,

Does this component on the hub provide what you need?

btw, If you’ve not used the hub before, you can drag the icon on the hub directly onto a workflow:

Hi Takbb,

I tried it out, but I was not able to figure out how to get the module to calculate IRR for each company and every quarter available for each company. I think this will give me just the total IRR for each company per last date?

Thanks!

I’ve not tried it myself, and I’ve not tried calculating IRR with KNIME. Do you have a small demo spreadsheet of sample(anonymized/fictitious) data that you’re trying to use in calculations ?

That would help others to be able to assist.

1 Like

I think the key to this is going to be to filter the data going into the IRR calc per customer & quarter. @takbb is right that it is hard to give solid guidance without seeing the data structure, dummy data & expected results.

Example IRR.xlsx (12.8 KB)
Hi Takbb & iCFO,

Attached is a example dummy data. I’ve added an extra column “fund” as specific company might have multiple investors. The key is to calculate IRR for each date of a valuation event occuring in the cashflows per company / per fund. Desired outputs format also in the same excel.

Thanks for help!

Yes, I think that you are on the right track :slight_smile: But as the dataset will have tens of quarters, and tens/hundreds of companies, i’m not sure hot to create a loop, batch, something that will be able to do this :thinking:

Ive added a dummy example of the data.

Thanks!

I found this from the components, I think its more suitable for this scenario IRR calculation. Now only thing is missing is how to get the IRR to be calculated based on the valuation events. :slight_smile:

I think this component would be excellent, if there would be one additional definition: IRR calculation date based on a value in column. ie. a dropdown that you could identify a specific transaction type from the list (in this case valuation) and whenever such an event occurs in the transactions, it would take the date and calculate the IRR backwards from that date for the specific company. This way, you would get the track history of a case calculated, and no need for workarounds. Also an additional classification of investor on top of the company would be extremely useful to calculate IRRs for multiple investors within the same case.

How difficult is it to get features added from Knime to these functions :)? Any workaround is also appriciated, as this would be a killer calculation to have :smiley:

Hi @Data_consumer , ordinarily, I’d say you could drop suggestions in the “Feedback and Ideas” section of the forum, and there’s nothing to stop you doing that as this appears to be a KNIME-supplied component., but the interesting thing here is that what you have there is a “component” rather than a “node”.

The distinction being the a component is actually just a small packaged up workflow and can be edited and adapted. (If you drop it in a workflow, you will see it looks like this, and you can right-click on it and open it to see inside. You cannot directly edit it in this state because it is in a “shared” state (denoted by the little arrow on the bottom left corner of its icon, but there is nothing to stop it being “unlinked” and then you can edit it, and save it somewhere locally for your own use (or even put it in your own space on the hub).

Opening it up, I see that as well as KNIME nodes it makes uses of at least one further component, which again be be opened to “look inside”.

All that said, if you can define how you perceive such a new version of the component working, then somebody here may be able to assist.

1 Like

HI Takbb, Thanks for clarifying! :=)

So, currently the XIRR module only reads following parameters:

  • Portfolio ID / Group by (company where the IRR is calculated from)
  • Value of transactions (negative and positive values for the IRR calculation)
  • Date of transactions (to calculate the IRR)

What I would like to archieve, is to have a few more parameters on the XIRR calculation:

  • New group by condition (investor / fund in this case)
  • IRR calculation date (give the XIRR component dates, that it needs to calculate the IRR for) so, in this case calculate IRR for all valuation dates.

As an output, I would have a table In the example sent in the previous post. Anyone skilled enough to help with this? :pray: :star_struck:

Thinking about it, even the second grouping is not needed, as I can combine the 2 fields, and create the unique ID from those, and then parse them into separate columns after the IRR calculation. So, the only modification I would need is the date insert for the IRR calculation (to be able to calculate the historical track of the IRR on a quarterly basis). :raised_hands:

1 Like

@Data_consumer, the only problem I have with this is I don’t have an accountancy background :wink: and whilst I recognise the phrase IRR, in terms of exactly how it is used and what numbers you expect to get out or unknowns to me, so I could try to assist, but I don’t know whether I would be on the right lines, or how to test it. It could be that I could offer a really simple solution but my domain knowledge is currently insufficient.

(Accepting that we are dealing with a single Company+Fund concatenation at any one time…) , for example, I think I saw that XIRR requires the “first value” to be negative, but I don’t know why, lol. Do you feed it all values? Or just all the equity values? Or all the valuation values up to the valuation date? Those are the kinds of basic questions I have.

Incidentally, on the forum if you prefix our forum names with @, it means we get a specific notification on the forum that you have directly mentioned us. I have on occasion found that somebody asked me a question in a post, but they missed the @ and I didn’t discover it until quite by accident months later.

1 Like

@Data_consumer … For example, I can put together a workflow based on my guessing at how this would hang together, but it’s the specifics of what values should be passed to the XIRR function for any given valuation

e.g. this workflow (which doesn’t produce correct results!), but may be similar to the kind of thing you are trying to achieve, albeit with corrections to the parts I don’t understand.

Calc XIRR - draft for comment.knwf (265.5 KB)

What I did here was for each “Valuation” pass the table of Equities for that company/fund for all dates up to that Valuation, and the valuation row itself. Now that probably isn’t right, and the results are nothing like the figures in you example spreadsheet but maybe this could be used as a discussion point, or possibly it’s close enough that you can fix it… or maybe it’s nowhere near how it should work :wink:

1 Like

Thanks, you are a star for helping out @Takbb! :star_struck: Sounds exactly like what I need! I will have a look into the example deeper and let you know. :slight_smile:

1 Like

@takbb Maybe a stupid question, but I cannot open the example workflow in my analytics client client… :see_no_evil: Is it done with a different version or is the file corrupted? Sorry…

Hi @Data_consumer ,

You should be able to import it. It written using KNIME 4.7.7 so should work with any client later than that. (And probably any 4.7 or 5.x client). I just imported ok into 5.2 as a check.

Which version are you on?

Edit:

I’ve (temporarily) uploaded it to the hub, so you should be able to drag it from there onto your KNIME AP desktop

1 Like

@takbb It works exactly like I wanted! A big thanks for the help! :slight_smile:

1 Like

You’re welcome @Data_consumer. Glad it worked for you.

This is how it could be turned into a component for doing the “periodic” IRR… (let me know if it requires any corrections! :slight_smile: )

Calc XIRR - component demo - 1.knwf (311.8 KB)

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.