2 Replies Latest reply: May 15, 2014 9:53 AM by Taylor _ RSS

    HELP!! Some Records Have Fields Some Dont?

    Taylor _

      Hello,

       

        I'm new to Monarch and have a question.

       

      I have a report like this:

       

        xxxxxx  xxxxxx xxxxxx

        xxxxxx  xxxxxx xxxxxx

        xxxxxx  xxxxxx xxxxxx

          PCN=xxxxxx JOB=xxxxxx

        xxxxxx  xxxxxx xxxxxx

        xxxxxx  xxxxxx xxxxxx

        xxxxxx  xxxxxx xxxxxx

       

      Some records have the second line (Like PCN=)

      and some dont.

       

      How do you capture this?

        • HELP!! Some Records Have Fields Some Dont?
          Grant Perkins

          Hi Taylor and welcome to the forum.

           

          Looks like you are diving in at the deep end on this one!

           

          The answer may turn out to very report specific and depend on the data content and format for a good result.

           

          One way that usually works is run the process in 2 parts.

           

          The first part requires a model that extracts just the extra lines when they occur and appends a key (unique key required) from the 'parent' line. Save the result as a simple external lookup file (assuming a PRO version of Monarch is available.)

           

          Then run the main process for the regular lines using an external lookup to check for any second lines previously extracted.

           

          It is normally possible to create a batch process to combine both activities and make the extraction a 'single click' operation.

           

          In this case another idea may work - no guarantess and you will need to check the results carefully and be satisfied that it does not produce unwanted data combinations.

           

          I assume you have created a template to extract the primary lines as you need them (i.e. the xxxxxx xxxxxx xxxxxx  lines.

           

          See if this works.

           

          Create another template using the same trap (or a trap that at least ENDS 'earlier' than the detail line trap but in effect traps based on the same line of data). Make this an APPEND template.

           

          For that line define a field in the HORIZONTAL position that the PCN field would occupy. In the field properties tabs select the ADVANCED tab and set the "Start field on" value to "preceding string" with the value "PCN" (based on the example - it may be different on the real report?)

           

          Add the field for "JOB" in its position with a preceding string of JOB.

           

          If all has worked out if you look in the table you should see all your detail records and for some of them where the second line exists you should also find the columns for those two fields populated. Those fields for all other records without second lines should be blank.

           

          Under the right circumstances this should work well but you do need to check that the trap definitions do indeed give you the results you require and no extra but unexpected population of the 2 extra fields against other records.

           

          I hope this helps in some way.

           

          Grant

          • HELP!! Some Records Have Fields Some Dont?
            Taylor _

            Thanks for the quick reply.

             

            your solution after "See if this works"

             

            worked great...