Using FormCalc language will make it easier...
In your balance field you should check if its index is higher than 0, if it is, then you should use the Balance before itself and add it to the current balance.
if ($.parent.index > 0) then
$.rawValue = Income - Expense + $.resolveNode(Concat("Table1.Row1[", $.parent.index - 1,"]")).Balance
$.rawValue = Income - Expense
It should be something like this... change the names to use the right reference_syntax
Thanks Magus069, it is easier in FormCalc and I didn't know that.
I have one question about code: ", $.parent.index - 1," - commas after and before Quotation marks are part of the syntax?
Yes, the Concat method in FormCalc is taking any value, converting the value into string and concats all the values together...
If you seperate the values you concat these:
$.parent.index - 1
Which should result in any of the rows you have in the form
if $.parent.index -1 is returning the right number, your Field is inside the row directly you only need 1 parent to reach the Row1
if $.parent.index -1 is not returning the right number, check in your hierarchy, your Field should be inside a form, which the form is directly in the row, so you would need 2 parent to reach your Row1
$.parent.index - 1 or
$.parent.parent.index - 1
Thank you! Very good explained!