3 Replies Latest reply on Apr 19, 2012 7:24 AM by JCPython

    if Calculation Result is empty then move to next...

    JCPython

      Title

      if Calculation Result is empty then move to next...

      Post

      i have a table that keeps records of recorded wight and length of animals, i also have fields that calculate to get the last inputed record and display it in the fields Current Weight and Current Length, sometimes weight or sometimes length isnt always recorded together, so weight may have data in a record and length can be empty, but since its all in one record table then Current weight will be updated, but since the length was left empty on the last record, it will display the current length as empty, is their a way to perform a script that if field is empty then get calculated data from the next most recent record?

        • 1. Re: if Calculation Result is empty then move to next...
          philmodjunk

          If this calculation is referring to records in a related table, make the relationship an unsorted relationship and see what is returned by the Last function. I've been told that this function returns the value of the last record that contains a value in the specified field--but I haven't tested this for myself so see if it works.

          Am also wondering if your data records might be a bit "cleaner" if you put weight measurements in one table and length in another so that you wouldn't have this issue in the first place...

          • 2. Re: if Calculation Result is empty then move to next...
            Sorbsbuster

            ...and sometimes having apparently correct info is worse than having missing data, because at least when it's mssing you know to go and fix something, whereas if it is fudged to appear filled in it's harder to know when you are being misled.  And if you start to use the figures for the animal equivalent of BMI you are really fudging potentially quite a bit.

            If you are prepared to have the fudge (and if Phil's suggestion doesn't work for you) you could have the new record automatically insert the data from the last record and then let the user over-write it.  If they don't, then at least it will have the last known value (just as you are suggesting here.)

            • 3. Re: if Calculation Result is empty then move to next...
              JCPython

              Thanks Phil!

              I was actually thinking about splitting the weight and length into seperate tables last night, makes sence to do it now.