9 Replies Latest reply: May 15, 2014 9:52 AM by meehflower _ RSS

    merge columns

    meehflower _

      I was wondering if monarch v 7 is capable of merging 2 columns?  Here is what my table looks like:

       

      CPUName  Start_time  Dependencies   Start_times_1

       

       

      What I wanted to do is if a cell in Start_time is empty, move information from Start_times_1 to Start_time.  I am not able to find it in the learning guide. Please help.

        • merge columns
          meehflower _

          I was wondering if monarch v 7 is capable of merging 2 columns?  Here is what my table looks like:

           

          CPUName  Start_time  Dependencies   Start_times_1

           

           

          What I wanted to do is if a cell in Start_time is empty, move information from Start_times_1 to Start_time.  I am not able to find it in the learning guide. Please help.

          • merge columns
            Grant Perkins

            You will need to create a new calculated field for this and us the IF() function.

             

            Your empty field may be empty or might contain NULL value, at least in  theory but either way the concept is the same, just the function used a little different.

             

            A Formula something like;

             

            IF(ISEMPTY(Start_time),[Start_times_1],[Start_time])

             

            Should do it.

             

            Use ISNULL instead of ISEMPTY if necessary.

             

            To some extent it depends on whether your field is defined as Character, Numeric or Date/Time.

             

            I hope this helps. It may be worth spending a little time with the Functions Reference Guide which, as I recall, expands a little on some of the Help entries and offers a very valuable reference point for advancing levels of Monarch modelling. It can be downloaded from the Datawatch web site.

             

            Grant

             

             

            Originally posted by meehflower:

            I was wondering if monarch v 7 is capable of merging 2 columns?  Here is what my table looks like:

             

            CPUName  Start_time  Dependencies   Start_times_1

             

             

            What I wanted to do is if a cell in Start_time is empty, move information from Start_times_1 to Start_time.  I am not able to find it in the learning guide. Please help. /b[/quote]

            • merge columns
              Grant Perkins

              You will need to create a new calculated field for this and us the IF() function.

               

              Your empty field may be empty or might contain NULL value, at least in  theory but either way the concept is the same, just the function used a little different.

               

              A Formula something like;

               

              IF(ISEMPTY(Start_time),[Start_times_1],[Start_time])

               

              Should do it.

               

              Use ISNULL instead of ISEMPTY if necessary.

               

              To some extent it depends on whether your field is defined as Character, Numeric or Date/Time.

               

              I hope this helps. It may be worth spending a little time with the Functions Reference Guide which, as I recall, expands a little on some of the Help entries and offers a very valuable reference point for advancing levels of Monarch modelling. It can be downloaded from the Datawatch web site.

               

              Grant

               

               

              Originally posted by meehflower:

              I was wondering if monarch v 7 is capable of merging 2 columns?  Here is what my table looks like:

               

              CPUName  Start_time  Dependencies   Start_times_1

               

               

              What I wanted to do is if a cell in Start_time is empty, move information from Start_times_1 to Start_time.  I am not able to find it in the learning guide. Please help. /b[/quote]

              • merge columns
                meehflower _

                Hi Grant,

                 

                Thanks but it does not work the way I wanted it.  What it did was it created another colunm and moved the value in Start_time_1 to that new column.  I actually wanted to move the values of Start_time_1 to Start_time only if Start_time cell is empty.  Do you think this is possible?

                • merge columns
                  meehflower _

                  Hi Grant,

                   

                  Thanks but it does not work the way I wanted it.  What it did was it created another colunm and moved the value in Start_time_1 to that new column.  I actually wanted to move the values of Start_time_1 to Start_time only if Start_time cell is empty.  Do you think this is possible?

                  • merge columns
                    aardvark _

                    If you need to preserve the column name Start_time for your output column, you could follow Grant's suggestion but change the name of your initial column from Start_time to, say, Start_times_0, and then name the calculated column Start_time.

                    • merge columns
                      aardvark _

                      If you need to preserve the column name Start_time for your output column, you could follow Grant's suggestion but change the name of your initial column from Start_time to, say, Start_times_0, and then name the calculated column Start_time.

                      • merge columns
                        meehflower _

                        Here's what I get:

                        Start_time   6:00 AM

                        Start_time_1           10:00 PM

                        Actual_Start           10:00 PM

                         

                        What I'd like is:

                        Start_time   6:00 AM

                        Start_time_1           10:00 PM

                        Actual_Start 6:00 AM   10:00 PM

                        • merge columns
                          meehflower _

                          Here's what I get:

                          Start_time   6:00 AM

                          Start_time_1           10:00 PM

                          Actual_Start           10:00 PM

                           

                          What I'd like is:

                          Start_time   6:00 AM

                          Start_time_1           10:00 PM

                          Actual_Start 6:00 AM   10:00 PM