### Title

Calculations - store - don't store

### Post

I was looking for some help around calculations and storing results. I have the following calculation which provides me a number: If ( IsEmpty ( Date Received ) and IsEmpty ( Date Accepted ); "Please Enter Dates"; Let ( [D2 = If ( IsEmpty ( Date Accepted ) ; Date Received ; Date Accepted ) ; My = If ( IsEmpty (Ax Date ) ; Get ( CurrentDate ) ; Ax Date )] ; My- D2)) Works fine. I use this field in a script which feeds a number into a report. BUT....if I allow it to create indexes as needed it doesn't update the number necessary. If I select don't store, recalculate as needed it takes ages for it to run that script. what am I doing wrong? Is there a way to update the info without it taking so long to run?

You are caught up in a classic "catch - 22".

Your calculation uses Get ( CurrentDate ) to get today's date to use in the calculation. If you make this a stored calculation, it won't update to show the correct value as time passes.

But as you have experienced, as an unstored calculation, certain database operations become much slower as Filemaker has to stop and build a "temporary index" before it can complete that action. The amount of added delay can be barely noticeable or hours long as it is a nonlinear function of the number of records involved.

There are a number of possible alternative approaches, from a script that updates this field for you to a modified script that uses a different method for achieving the same result as your current script, but whether any of those are possible or practical would require a more complete picture of how you are using this calculation field and what your script has to do.