4 Replies Latest reply on May 25, 2012 10:14 AM by heraldst

    Text calculations / skipping empty fields?

    heraldst

      Title

      Text calculations / skipping empty fields?

      Post

      I've created a text calculation defined by 7 different fields on my database. 

      This works perfectly, however not all 7 fields are always in use for all records.  It's the same field that sometimes is left blank because the information is not relevent for each record.  

      When the field is blank, the text calculation leaves the line blank.  Is there anyway to create a calculation that doesn't leave the line blank, but rather skips that empty field? 

      By leaving it blank it creates an empty line between two lines that should be one on top of another.  

      Make sense?  

        • 1. Re: Text calculations / skipping empty fields?
          Sorbsbuster

          Posting the calculation you are using may have helped...

          If you are doing this:
          Field1 & "---" & Field2 & "---" & .... & Field7

          you could change it to be

          Case (Field1 = "" ; "" ; Field1 ) & etc

          Or, if each field is separated by a return, I think you could have:

          List ( Field1 ; Field2...; Field7 )

          • 2. Re: Text calculations / skipping empty fields?
            heraldst

            Hi Sorbsbuster, 

             

            Here are my calculations: 

            Artist  &  " "  &  ¶  &  Title  &  " "  &  ¶  &  Year  &  " "  &  ¶  &  Medium   &  " "  &  ¶  &  Dimensions  &  " "  &  ¶  &  "Ed."  &  " "  &  Edition  &  " "  &  ¶  &  HS Number

            Basically I want my field to show: 

            Artist

            Title

            Year

            Medium

            Dimensions

            Ed. edition number

            HS number

             

            The problem is that not all of the artworks in the database have an edition number.  Where they don't, I don't want that to be a blank line, I'd like the next line to be 'HS number'.  

            I've written in 'Ed.' because the field for 'Edition' only contains the edition number and I want the calculated field to say 'Ed.' before the edition number. Any way to skip this too?

            I know this is really specific, but I only have basic filemaker skills.  Any advice (like particular calculations...) would be great!

            • 3. Re: Text calculations / skipping empty fields?
              philmodjunk

              As Sorbsbuster suggested, do it this way:

              List (Artist  ;  Title ; Year  ;  Medium   ;  Dimensions  ;  If ( Not Isempty ( Edition ) ; "Ed."  &  " "  &  Edition ) ; HS Number )

              • 4. Re: Text calculations / skipping empty fields?
                heraldst

                That worked.  Thank you!!!