5 Replies Latest reply on Mar 7, 2014 9:18 AM by philmodjunk

    Editing text with calculated result

    lbellino

      Title

      Editing text with calculated result

      Post

           I'm sure there is a way to do this, but can't seem to figure out the correct calculation to have this work. I currently have two fields. One that shows text such as, "Gross Mens" and I have another field where I want to have a calculated result to remove the word, "Gross" and just have it be shown as "Mens". But I don't want the first field to change, which is why I created the second field. What's the calculation for this to remove certain text, such as this example of "Gross"? Thanks.

        • 1. Re: Editing text with calculated result
          philmodjunk

               Substitute ( Field2 ; "Gross" ; "" )

          • 2. Re: Editing text with calculated result
            lbellino

                 This calculation worked and did what I needed it to do. But when updating the field where I want to use this became more complicated than I thought. I currently have a layout that is set and do not want to change the fields that are in this layout and portals. I made a copy of this layout and wanted to modify it to show slightly different info. I'm going to upload a few images, so if you can wait until I post them all before responding, would appreciate it. These images will show how the portal is currently set up and one image will explain what info. I want displayed in the portal. Basically, for only department names that have "combo pad" listed on left side in this first image, in the portal next to it, I want to be able to select the department names that are included in the combo pad. Which will have at least 2 or more departments that need to be listed in the portal. The "after" image shows that I've selected "Gross Juniors", but this is where the substitute calculation comes into play, where I only want it to read, "Juniors". And this is only for this layout. The original layout that I copied this from, should not be affected with these changes that I want to make. I'm going to try and provide all the images that I think you would need to see on how this original portal was set up (not by me), which is why I'm not sure how to get this to work. Thanks for your help and patience with me.

            • 3. Re: Editing text with calculated result
              lbellino
              /files/ece32d2f5f/PORTAL_2.jpg 1112x929
              • 4. Re: Editing text with calculated result
                lbellino

                     This is the last image. If you need me to provide anything else to help you with this, just let me know.

                • 5. Re: Editing text with calculated result
                  philmodjunk

                       I'm not sure that I'd use a calculation field at all for this. I'd need to know a lot more about the design and intended function of your database, but there's a good chance that I'd use a related table to match records with specific text such as "Juniors" with records that have "combo Pad" entries in them.

                       Your second screen shot shows a design error that will result in problems on your layout. The ::DepartmentName field is not place where it can work with this portal. It looks like your portal rows would need to be reduced and then made taller so that both fields under the "department" label fit inside a single row of the portal.

                       To use the calculation field approach, you could do this:

                       If ( PatternCount ( LefthandFieldHere ; "combo pad" ) ; Substitute ( FieldInPortalHere ; "Gross" ; "" ) ; FieldInPortalHere )

                       

                            The original layout that I copied this from, should not be affected with these changes that I want to make

                       But these changes take place in the records of a table which are then displayed on your layouts. To keep the changes from affecting your original layout, you'll need two fields, one that makes this change and one that does not so that you can use both fields on different layouts.