4 Replies Latest reply on Feb 1, 2012 11:45 AM by BradWieland

    help with calculation...

    BradWieland

      Title

      help with calculation...

      Post

      How would I set this up:?

      I want to populate a field called "High Rez Photo ID" with 2 different possibilites.

      1. If the field "SingleOrSharedPhoto" contains "has own photo",  the field called "High Rez Photo ID" will be populated with the contents of the field "Auto Photo Path".

      2. If the field "SingleOrSharedPhoto" contains "shares a photo", the field called "High Rez Photo ID" will be populated with the contents of the field called "Photo Sharing ID".

      The results of this calculation will be image file names ending in .jpg. I'd like to replace the .jpg with .tif

      Make sense?

        • 1. Re: help with calculation...
          philmodjunk

          "contains" means theres more data than the quoted phrases? or could we say "equals"?

          If we can use "equals" we can have this expression:

          If ( SingleOrSharedPhoto = "has own photo" ;
                   Left ( Auto Photo Path ; Length ( Auto Photo Path ) - 4 ) & ".tif" ;
                   Left ( Photo Sharing ID ; Length ( Photo Sharing ID ) - 4 ) & ".tif" )

          if we are dealing with "contains" we can change the first term to:

          If ( PatternCount ( SingleOrSharedPhoto ; "has own photo" ) ;

          • 2. Re: help with calculation...
            BradWieland

            You're right, "equals" is what I want. Regarding the ".tif"...the file names will include a .jpg extension. Will your formula above replace those?

            Also, forgive my "green-ness" but, would I paste your formula above just as you've typed it, indented at the left?

            • 3. Re: help with calculation...
              philmodjunk

              You can paste it if I have the field names correct and all fields are defined in the same table as your calculation field.

              The expression I used strips off the last 4 letters and replaces it with ".tif". This assumes that all data in the two fields comes with a 4 character file extension.

              • 4. Re: help with calculation...
                BradWieland

                Awesome, worked perfectly the first try! ...I appreciate your help!