3 Replies Latest reply on Jan 25, 2011 9:24 AM by philmodjunk

    Need to replace all empty fields with NA

    JulieByrd1880

      Title

      Need to replace all empty fields with NA

      Post

      For my statistics program to work with my filemaker export, I can't have blank fields.  Is there a way to replace all empty fields over the entire database with "NA"?

        • 1. Re: Need to replace all empty fields with NA
          Rajkumar

          It depends when u want, and for which field u would like to perform such operations.

          Case 1: for some fields, u want to place "NA" at the beginning, i.e. the time when u created that record.

                     for this, goto auto enter->calculation, and there u can put the required condition, like :put "NA";

          Case 2: After inserting values in some field, u want to insert "NA" for all empty fields, then write a script, which'll check a field whether    it's empty or not, if so then put there value "NA".

          • 2. Re: Need to replace all empty fields with NA
            JulieByrd1880

            So how do I write that script? I need to do it for all fields.  I might just do it in excel...

            • 3. Re: Need to replace all empty fields with NA
              philmodjunk

              Someone else asked this same question and we came up with a way to do it with an auto-enter calculation you can copy and paste into the auto-enter calculation box for each such field where you want this.

              Step 1: define a number field that auto-enter's a serial number, but define it to assign the number "on commit" instead of the default "on create" setting.  I'll call this field ID for this example.

              Then this auto-enter calculation will assign NA to the field only if it is empty at the time the record is committed:

              If ( IsEmpty ( Self ) and ID ; "NA" ; Self )