AnsweredAssumed Answered

Stored Calculation Question

Question asked by AllegroDataSolutions on Feb 3, 2016
Latest reply on Feb 3, 2016 by AllegroDataSolutions

I am developing a database that a client started building. It has a bar graph which compares the total sales for the previous and current years. The dollar values are on the vertical axis. The horizontal has two bars for each month (the first bar being for the previous year and the second for the current year). The values come from a related table to the seller record being viewed. It contains fields for the dollar amount of each invoice, the month, and the date. To this I have added calculation fields to show the dollar amount if the sale occurred in the previous or current year. Also added two summary fields, that total the values of these fields (this is the data plotted on the chart).


It works. But I don't think I'm done. Since the values of calculated fields are stored, my concern is what will happen next year, when the value of Year(Get(CurrentDate)) will change from 2016 to 2017, and the value of  Year(Get(CurrentDate))-1 will become 2016. My first question is will they even update, unless every record is visited, changed and saved? If the answer is yes, I'm thinking of having a server-side script to force the update on New Year's Eve, before anyone uses the database, because there will be tens of thousands of records to update. My second question is whether there is a better way to do this  -- i.e. getting the values of the calcs, and therefore the summaries, by some other means (unstored calcs, global fields, etc.).