2 Replies Latest reply: May 15, 2014 9:58 AM by Mike Urbonas RSS

    Trapping Multiple Fields

    kmiller _

      Hi!  Please forgive what seems a simple question compared to what I have read in this forum.  I am a "fill-in" for our regular monarch person who is in France for 3 weeks...

       

      I have a report which looks like this:

      [font="courier"]1235  601 Jones   Ins102  pipes  Date Pass     

                        Insp657 elect  Date Fail

                        Insp985 final  Date Pass

      1236  825 Jones   Insp345 gas    Date Pass

                        Insp333 roof   date Fail[/font][/quote]I am having a problem trapping the data because the number of lines of inspections vary for each home. I first tried having the first line as the append trap and the other lines as details, but I got a blanks in the number and address fields.  When I try a multiple line trap in the detail it picks up the next addresses inspections in short records.

       

      I really appreciate your help on this one.

       

      Thanks.

       

      [size="1"][ May 30, 2003, 10:04 AM: Message edited by: Mike Urbonas ][/size]

        • Trapping Multiple Fields
          Grant Perkins

          Hi kmiller,

           

          You don't say what you are looking for in the output table but I guess you may want one row per home?

           

          Do you know the maximum number of inspection rows a home may have in your report? If you do one way address this is to treat each address as a multi-line record and set the number of rows in the in the template to as many as the largest number of rows you will find on your report.

           

          Identify the fields you require in each column and for each row of each column create a field with a different name. For example if you need 20 rows and there are 4 columns of data you would have a column of fields for column A perhaps called A1 to A20, the same for B, C and D.

           

          The model will then select all the rows until it reaches the next detail record.

           

          There is a similar (but slightly more complex) example somewhere back in the forum a few months ago. Have a look  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000114"]here.[/url]

           

           

          If you send me a Private Message through the forum with your email address I will send a model and your sample text file layout that should give you one solution to the problem. There may be others.

           

          I hope I have understood what you are looking for and that this might help a little.

           

          Grant

           

          AMENDMENT!

           

          I suspect that Mike Urbonas has provided the answer you really need in the next post. I have a feeling I was looking at something a little more complicated than you needed.

           

          Also the proposed solution may well not work for you. I have remembered that the previous post I referenced relied upon each of the fields which might exist having a 'prompt' (by way of the title for the data) in front of the field required and that was a key component of the workability of the solution. Looks like your data will not have that so the solution would not work anyway if records for different properties had different numbers of lines.

           

          Go for Mike's solution or look for his solution to Pete's problem  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000204"]here[/url] which is the alternate solution to my original proposal and should work for your problem IF you want all of the properties' inspection detials in a single row in the table.

           

           

              Originally posted by kmiller:

          Hi!  Please forgive what seems a simple question compared to what I have read in this forum.  I am a "fill-in" for our regular monarch person who is in France for 3 weeks...

           

          I have a report which looks like this:

           

          1235  601 Jones   Ins102  pipes  Date Pass     

                            Insp657 elect  Date Fail

                            Insp985 final  Date Pass

          1236  825 Jones   Insp345 gas    Date Pass

                            Insp333 roof   date Fail

           

          I am having a problem trapping the data because the number of lines of inspections vary for each home. I first tried having the first line as the append trap and the other lines as details, but I got a blanks in the number and address fields.  When I try a multiple line trap in the detail it picks up the next addresses inspections in short records.

           

          I really appreciate your help on this one.

           

          Thanks. /b[/quote]

           

          [size="1"][ May 19, 2006, 11:48 AM: Message edited by: Todd Niemi ][/size]

          • Trapping Multiple Fields
            Mike Urbonas

            Originally posted by kmiller:

            Hi!  Please forgive what seems a simple question compared to what I have read in this forum.  I am a "fill-in" for our regular monarch person who is in France for 3 weeks...

             

            I have a report which looks like this:

            [font="courier"]1235  601 Jones   Ins102  pipes  Date Pass     

                              Insp657 elect  Date Fail

                              Insp985 final  Date Pass

            1236  825 Jones   Insp345 gas    Date Pass

                              Insp333 roof   date Fail[/font][/quote]I am having a problem trapping the data because the number of lines of inspections vary for each home. I first tried having the first line as the append trap and the other lines as details, but I got a blanks in the number and address fields.  When I try a multiple line trap in the detail it picks up the next addresses inspections in short records.

             

            I really appreciate your help on this one.

             

            Thanks. /b[/quote]Hi

             

            I think all you need is a Detail trap - no Append levels necessary.  You can trap based on the common position of the letters "Ins" or the common position of the dates.

             

            Then in the Table view, for your address and name fields, double click on those columns and check the box "Display value of previous record" and Monarch will fill in the blank records within these columns.

             

            Mike