4 Replies Latest reply on Apr 25, 2017 6:48 AM by philmodjunk

    overdue day calculation

    jkahnscolaro

      If ( not IsEmpty ( Obj 1A completed  );  Update 1 due - Obj 1A completed )

      If (IsEmpty ( Obj 1A completed ); Update 1 due - Get ( CurrentDate ))

      I wonder if anyone knows which connector needs to be in between these parts of the calculation to get to the number of overdue days of a plan.  i have tried or, and , and several others with no luck.   Thank you!

        • 2. Re: overdue day calculation
          fmpdude

          First, define exactly what you mean by overdue in terms of your data, that is, define the "business rule". That definition should be in words, not IF statement syntax, though you can say "if this is true then that and that and this and that", but don't concentrate on FMP/other syntax during that definition.

           

          Once you define the rule relative to your data, the calculation usually falls right out.

          • 3. Re: overdue day calculation
            Menno

            I suppose that you just have one field that should calculate the overdue-days and you showed 2 separate calculations. The 2 can be forged into a case-calculation like this one:

            Case (

                 not IsEmpty ( Obj 1A completed  ) ; Update 1 due - Obj 1A completed ;

                 IsEmpty ( Obj 1A completed ) ; Update 1 due - Get ( CurrentDate ) )

            Make sure that you select the "unstored" box in under the "storage" button in the calculation-definition

            • 4. Re: overdue day calculation
              philmodjunk

              If ( not IsEmpty ( Obj 1A completed  ); 

                    Update 1 due - Obj 1A completed ) ;

                     Update 1 due - Get ( CurrentDate ))

               

              case could be be used in place of If. No need to do isempty twice.