1 Reply Latest reply on Dec 29, 2014 7:26 AM by Mark_M

    Calculation for Approaching Due Dates

    SydneyBlock_1

      Title

      Calculation for Approaching Due Dates

      Post

      I am trying to create a calculation to tell when a vehicle's inspection is approaching, due and overdue. My problem is I don't know how to make my calculation decipher between the 3. I've tried a nested if function, but that returns all 3 values. Instead of showing one or the other, all 3 values come up if the function is equal to "overdue." Anyone have any tips on how to accomplish this?

        • 1. Re: Calculation for Approaching Due Dates
          Mark_M

          >

          You may want to play around with a CASE statement instead of a nested IF, it can be less confusing.  In the CASE function the system performs a series of tests, the first one in order that returns "True" then executes the result calculation.  When you pull it in it loks like this: "Case ( test1 ; result1 {; test2 ; result2 ; ... ; defaultResult} )".  I usually use returns to make it more readable, here is a sample for checking a date:

          Case (
          Date_Value > Get ( CurrentDate ); "Future";
          Date_Value = Get ( CurrentDate ); "Due";
          Date_Value < Get ( CurrentDate ); "Over Due";
          "Error")

           

          >>>>