2 Replies Latest reply: May 15, 2014 10:00 AM by Grant Perkins RSS

    Capturing data so it shows on the same row

    Randybow _

      I'm new to Monarch and have a problem with a report I am trying to set up the template for.

       

      The report is a text file which has columns in it however under a row may be one or several rows of comments that are not in columns but go across 6 or 7 columns and are not always the same length. 

       

      I'm able to set up the template to capture the columns and then an append template to capture only the coments but when I open the table window, the comments are in a separate column but not in the same row as the data they go to.  In some cases, it repeats.

       

      I tried setting up the tree but even that didn't work.

       

      Can someone please tell me what I am doing wrong?

        • Capturing data so it shows on the same row
          Nigel Winton

          Hi There and Welcome to the Forum

          Have you realised that Appends work upwards, that is the data you are treating as an append will be append to the detail below it.

           

          Header XXXXX

          Data                YYYYY

           

          Data will be your Detail trap and Header will be the first Append to it.

          If you follow this you should find things will fall into place, if you attempt to use data below the detail field you will get the results you are seeing.

           

          Let us know if this solves your problem, or if you need any further help. If you can post an example of you report you are working with that will help us to help you.

           

          Regards

           

          Nigel

          • Capturing data so it shows on the same row
            Grant Perkins

             

            The report is a text file which has columns in it however under a row may be one or several rows of comments that are not in columns but go across 6 or 7 columns and are not always the same length. 

             

            I'm able to set up the template to capture the columns and then an append template to capture only the coments but when I open the table window, the comments are in a separate column but not in the same row as the data they go to.  In some cases, it repeats.

             

            /quote

             

            Further to Nigel's good guidance ...

             

            Do the long lines of text ALWAYS appear under the lines with columns or, as I suspect from your description, only sometimes appear?

             

            If only sometimes, is there anything on the TEXT line(s) BEFORE the text that would be unique to that line - for example a field Name Tag? Or maybe just a unique number of spaces preceding the text?

             

            I think you have landed up at the almost-compulsory-for-people-new-to-Monarch situation where your early involvement requires some advanced and not totally intuitive tricks that, once known, will make life much easier. But they are not covered in the basics!

             

            If you make your APPEND TEMPLATE with EXACTLY THE SAME trap as your detail template you can 'cheat' the rule that Nigel mentions above and have the potential for field(s) in an APPEND that appear AFTER the detail line.  It will also stop the repeats since in effect using the same trap means that the APPEND is reset for every new DETAIL template.

             

            Now the next trick is to find a way to identify the field when it appears. You will need to paint the field that would trap you text line and then identify the best way to pick it out when it exists. (It will simply be a blank table field entry if there is no line.) Don't worry about making the sample data 2 lines, with luck you won't need to.

             

            You will need to look at the ADVANCED PROPERTIES tab for the field and possibly use the "Start Field on" option of 'After the last field in the template' or, if something suitable is available to you, one of the preceding string options. (If you are using an older version of Monarch there will only be one preceding string option available to you.)

             

            If you are able to post here a reasonable sample of the format of the report with examples of all the line variants (1 line, 2 line, any examples of variation on the second line format and so on.) I could be more specific.

             

            It is all much easier to do than to describe so you may not need the specific help once you have had a look at it working with this suggestion.

             

            Let us know how you get on.

             

            HTH

             

            Grant