Could you expand on your example so we may get a better understanding of what you are trying to do?
previous link and advice can be found here if anyone is looking for background I need to automatically calculate a field based on values from previous rows
It looks like clarity is needed on both of these threads. Is there a way to combine both of them in order to consolidate and alleviate confusion?
Waiting for clarification ... but that is not in our hands
Thanks for your reponse(s), what i want to achieve is to get the sum total of values from a field called population, but i really don't want the final sum, what i need is to get the sum as you loop through the rows (that's the population value) i.e if
row 1 = 23 (row 1 would be 23 as there's no other row/record before row1)
row 2 = 30 (row 2 would be 30 + the value in row 1)
row 3 = 22 (row 3 would be 22 + the value in row 2), till you reach the last row.
I also want to add a constraint whereby if the sum of the population values in the rows becomes 500, the next row's value would start from zero or the difference that makes the 500 from the previous row. Thanks
The first part of your request, if I understand it, seems straightforward enough, but I don't get the threshold condition. You state if the population values in the rows becomes 500 (do you mean exactly 500?), then the next row's value is either zero or some difference. Well, which is it, zero or the difference? Can you present an example like the one above but showing the 500 threshold value in action?
Thanks for your views, the threshold is for any population value that falls between 450 - 500, now if the population for a particular row adds up to 503 - the population value of the next row would be (503 - 500) + the absolute population value of that row, likewise if the population for a particular row adds up to 498, then the population value of the next row would automatically start from the absolute population value of that row as nothing would be added to the absolute population value for that particular row.
the quickest way would be to use a spreadsheet since you can copy the formula as you need it. Since you don't seem to be doing thousands or rows nor have you indicated that this would be a daily calculation, it may be faster in the long run to set up a template spreadsheet, then bring it into Arc* for further work.
It's such a bummer when the quickest way is to not use Python, but easier is easier... I agree with Dan.