Refering to data in previous item of a list
I have pulled a list in a module and this list contains data for various events. Now I want that the calculation on any event in the list to act on the data on the previous list. Example: I have 3 line items in my module, namely the principal amount, increase rate (different for different time periods and events) and a final value. A list named Events has been pulled as a dimension in this module. Now I want that the first item in Events takes principal and rate values from another module and calculates the final value. The second item of the list to take this final value as its principal input and using rate calculate a final value; which will be used as the principal for third item in the list.... and so on. How can we achive this?