{ Analytica Model CashFlow, encoding="UTF-8" } SoftwareVersion 6.2.0 { System Variables with non-default values: } SampleSize := 1000 TypeChecking := 1 Checking := 1 SaveOptions := 2 SaveValues := 0 {!-50299|DiagramColor Model: 65535,65535,65535} {!-50299|DiagramColor Module: 65535,65535,65535} {!-50299|DiagramColor LinkModule: 65535,65535,65535} {!-50299|DiagramColor Library: 65535,65535,65535} {!-50299|DiagramColor LinkLibrary: 65535,65535,65535} {!-50299|DiagramColor Form: 65535,65535,65535} NodeInfo FormNode: 1,0,0,,0,0,,,,0,,,0 {!-50299|NodeColor Text: 62258,62258,62258} {!-60000|Attribute AcpStyles} Model CashFlow Description: Demonstrates the Cumulate function for cumulating cash flow. In response to this question:~ ~ I am a relative neophyte in using indexed parameters. I want to calculate a cumulative cash flow by year from a table of cash flows, in order to calculate when a project will break even. I am looking for the syntax of a call on each row of my cash flow list to add it to the previous row of my cumulative cash flow list. Once I have that, I also want to calculate a similar list of discounted cumulative cash flows to understand the effect of discounting the cash flow. Is it worthwhile to create a second index with cash flow, cumulative cash flow, and discounted cash flow? Or is there an even more clever way to do this using features I am unaware of? Author: Dale Rice~ Lumina Decision Systems Date: Fri, Feb 4, 2022 5:42 PM DiagState: 2,0,0,623,333,17,10 WindState: 2,422,319,720,350 FontStyle: Arial,15 FileInfo: 0,Model CashFlow,2,2,0,0,W:\Tech Support\CashFlow.ana Index Year Att_PrevIndexValue: [0,1,2,3,4,5,6,7,8,9] Title: Year Definition: 0..9 NodeLocation: 80,48,1 NodeSize: 64,24 Variable Annual_cash_flow Title: Annual cash flow Definition: Table(Year)(-423K,-123K,59.341K,174.564K,-431,174.11K,249.337K,494.3K,50.206K,226.028K) NodeLocation: 80,128,1 NodeSize: 64,24 ValueState: 2,1117,26,416,303,0,MIDM Variable Cum_cash_flow Title: Cum cash flow Definition: Cumulate(Annual_cash_flow,Year) NodeLocation: 80,216,1 NodeSize: 64,24 ValueState: 2,659,23,416,366,0,MIDM Variable Breakeven_year Title: Breakeven year Definition: SubIndex(discounted_cum_cash_>=0,True,Year,first:true);~ NodeLocation: 392,128,1 NodeSize: 64,24 ValueState: 2,1020,455,416,303,,MIDM Variable Fraction_of_breakeve Title: Fraction of breakeven year Definition: 0 - discounted_cum_cash_[Year=Breakeven_year-1] NodeLocation: 392,208,1 NodeSize: 64,24 ValueState: 2,550,484,416,303,,MIDM Variable discounted_cum_cash_ Title: discounted cum cash flow Definition: Cumulate(~ Annual_cash_flow * (1 - Discount_rate)^(@Year-1)~ , Year ) NodeLocation: 240,128,1 NodeSize: 64,24 ValueState: 2,660,27,416,303,,MIDM Decision Discount_rate Title: Discount rate Definition: Choice(self,1) NodeLocation: 240,48,1 NodeSize: 64,24 NumberFormat: 2,%,4,2,0,0,4,0,$,0,"ABBREV",0,,,0,0,15, {!40300|DomainExpr: Discrete(0,0.07,type:'number')} Close CashFlow