Page 1 of 1

How to Reset a Stock?

Posted: Mon Nov 06, 2017 2:35 am
by Alsulaim
I have a stock that is accumulating data per hour. How can I reset it at the end of some period?

I need to accumulate dollar savings per day to reach a monthly total, then use that total as an input to another part of the model. Therefore, at the end of every month I have to reset the savings stock to start accumulating the savings of the next month. Is this even possible? If so, how can I also store that monthly value to be used somewhere else in the model?

Any help is appreciated here!

Thank you!

Re: How to Reset a Stock?

Posted: Mon Nov 06, 2017 7:29 am
by Administrator
This structure will reset the savings at time = 30. I'm sure you can adjust it to reset the savings at the end of each month.

Code: Select all

cumulative savings = integ( savings - end of month savings reset , initial savings )

end of month savings reset =  if then else ( time = 30 , cumulative savings , 0 )