here in the image
1st, 2nd and 3rd columns are input and it has to generate the 4th, 5th and 6th column
can anyone help me with this
4th column will be calculated with 3rd column/1st column
5th is minus of 4th column
6th is increment of 1 year
for brief it is a depreciation logic for every year
Discussion posts and replies are publicly visible
a!forEach( items: enumerate(ri!years) + 1, expression: { a!localVariables( local!calculateDepreciationAmt: ri!actualAmount / ri!years, local!marketValue: ri!actualAmount - (local!calculateDepreciationAmt * fv!item), local!depreciationDate: todate( datetime( year(tostring(ri!registrationDate_dt)) + fv!item, month(tostring(ri!registrationDate_dt)), day(tostring(ri!registrationDate_dt)) ) ), { local!calculateDepreciationAmt, local!depreciationDate, local!marketValue } ) } )
What happens when last iteration of ri!years not gives 0? You said iterate untill column E reaches 0?
KM said:so we have to calculate until amount comes to 0, by incrementing every year
so we have to calculate until amount comes to 0, by incrementing every year