3 Replies Latest reply: May 15, 2014 9:52 AM by Nigel Winton RSS

    Adding Data in the same field

    Monarch_Guru _

      Hi,

       

      I have two fields/columns (A & B) in my Table section.  What I want to do is, at any row, if the data in Field A are the same but the data in Field B are different, I want to add the data in Field B with the word "and" within the same field.  For example,

       

      Problem

       

      Field A          Field B

      Orange           Sweet

      Apple            Sweet

      Apple            Sour

       

      Solution

       

      Field A          Field B

      Orange           Sweet

      Apple            Sweet and Sour

       

      Thanks.

        • Adding Data in the same field
          Monarch_Guru _

          Hi,

           

          I have two fields/columns (A & B) in my Table section.  What I want to do is, at any row, if the data in Field A are the same but the data in Field B are different, I want to add the data in Field B with the word "and" within the same field.  For example,

           

          Problem

           

          Field A          Field B

          Orange           Sweet

          Apple            Sweet

          Apple            Sour

           

          Solution

           

          Field A          Field B

          Orange           Sweet

          Apple            Sweet and Sour

           

          Thanks.

          • Adding Data in the same field
            Nigel Winton

            HI

            The solution to this depends on how many different values you will have in column B. If it is just 2 then you could do it in Monarch with a 2 pass. If more then you would be better off writing an Excel macro to do it.

            Assuming it is only 2 then you could do a summary to show column b as the across and count as the measure. Export this to excel and re-open it as a database. You should then get a new table something like this

             

             

            FIELD         SOUR      SWEET

            Apple            1          1

            Orange           0          1

             

            Then you could apply a calculated field like this

             

            if(sour=1.and.sweet=1,"sour and sweet",if(sour=0.and.sweet=1,"sweet",if(sour=1.and.sweet=0,"sour","")))

             

            and you should have your answer.

             

            Nigel

            • Adding Data in the same field
              Nigel Winton

              HI

              The solution to this depends on how many different values you will have in column B. If it is just 2 then you could do it in Monarch with a 2 pass. If more then you would be better off writing an Excel macro to do it.

              Assuming it is only 2 then you could do a summary to show column b as the across and count as the measure. Export this to excel and re-open it as a database. You should then get a new table something like this

               

               

              FIELD         SOUR      SWEET

              Apple            1          1

              Orange           0          1

               

              Then you could apply a calculated field like this

               

              if(sour=1.and.sweet=1,"sour and sweet",if(sour=0.and.sweet=1,"sweet",if(sour=1.and.sweet=0,"sour","")))

               

              and you should have your answer.

               

              Nigel