3 Replies Latest reply: May 15, 2014 10:12 AM by Grant Perkins RSS

    Trapping Help

    Rusch Mauzy

      [SIZE=3][FONT=Calibri]Attached is a text file.  The file is an invoice file from one of our suppliers.  We’re trying to get a summary view and some other info out of the file that they cant provide.  My issue comes in the detail template.  /FONT[/SIZE][/FONT]

      [FONT=Calibri][SIZE=3] /SIZE[/FONT][/FONT]

      [SIZE=3][FONT=Calibri]We may incur the following charges on invoices:[/FONT][/SIZE][/FONT]

      [FONT=Calibri][SIZE=3] /SIZE[/FONT][/FONT]

      [SIZE=3]-[/SIZE][/FONT][FONT=Calibri][FONT=Times New Roman]          /FONT[/FONT][FONT=Calibri][SIZE=3]Hauling[/SIZE][/FONT]

      [SIZE=3]-[/SIZE][/FONT][FONT=Calibri][FONT=Times New Roman]          /FONT[/FONT][FONT=Calibri][SIZE=3]Wait Time[/SIZE][/FONT]

      [SIZE=3]-[/SIZE][/FONT][FONT=Calibri][FONT=Times New Roman]          /FONT[/FONT][FONT=Calibri][SIZE=3]Stop Charge[/SIZE][/FONT]

      [SIZE=3]-[/SIZE][/FONT][FONT=Calibri][FONT=Times New Roman]          /FONT[/FONT][FONT=Calibri][SIZE=3]Out of Miles /SIZE[/FONT]

      [SIZE=3]-[/SIZE][/FONT][FONT=Calibri][FONT=Times New Roman]          /FONT[/FONT][FONT=Calibri][SIZE=3]Fuel Surcharge[/SIZE][/FONT]

      [FONT=Calibri][SIZE=3] /SIZE[/FONT][/FONT]

      [SIZE=3][FONT=Calibri]We will always have the hauling charge but then may or may not have any combination of the other charges.  Therefore it becomes difficult to define the fields without knowing how to tell monarch when to start or stop.  It will make more sense when you review the files.[/FONT][/SIZE][/FONT]

       

                                                                  10/31/11   206073   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/24/11  00507          DELIVERED   9/25/11  80350

                TALSMA                              BORDENS

                HICO, TX                            DALLAS TX  75215

                B/L 2                               B/L 2

                P/O 1086575                         P/O 1086575

                TRUCK    79149   TRAILER T509

                MILK                                49000   LBS

                HAULING                            490.00   CWT         .650     318.50

                ROUTE 8107

                    •   $318.50  TOTAL FOR LOAD MI   304370 02 MI  * * * * * * * * * * * * * *

                                                                                      $318.50

       

       

       

       

                                                                  10/31/11   206074   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/24/11  00537          DELIVERED   9/25/11  80350

                2 SISTERS DAIRY                     BORDENS

                HICO TX  76457                      DALLAS TX  75215

                B/L 3                               B/L 3

                P/O 1086578                         P/O 1086578

                TRUCK    639     TRAILER T333

                MILK                                52080   LBS

                HAULING                            520.80   CWT         .650     338.52

                DEMURRAGE                                                        236.25

                W/T @ UNLD

                ROUTE 8137

                    •   $574.77  TOTAL FOR LOAD MI   304371 03 MI  * * * * * * * * * * * * * *

                                                                                      $574.77

       

       

       

       

                                                                  10/31/11   206075   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/24/11  00507          DELIVERED   9/24/11  80350

                TALSMA                              BORDENS

                HICO, TX                            DALLAS TX  75215

                B/L 4                               B/L 4

                P/O 1086576                         P/O 1086576

                TRUCK    437     TRAILER T276

                MILK                                49940   LBS

                HAULING                            499.40   CWT         .650     324.61

                ROUTE 8107

                    •   $324.61  TOTAL FOR LOAD MI   304376 02 MI  * * * * * * * * * * * * * *

                                                                                      $324.61

       

       

       

       

                                                                  10/31/11   206076   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/25/11  00537          DELIVERED   9/25/11  80350

                2 SISTERS DAIRY                     BORDENS

                HICO TX  76457                      DALLAS TX  75215

                B/L 6                               B/L 6

                P/O 1084554                         P/O 1084554

                TRUCK    639     TRAILER T415

                MILK                                50720   LBS

                HAULING                            507.20   CWT         .650     329.68

                DEMURRAGE                                                        180.00

                W/T @ UNLD

                ROUTE 8137

                    •   $509.68  TOTAL FOR LOAD MI   304377 03 MI  * * * * * * * * * * * * * *

                                                                                      $509.68

       

       

       

       

                                                                  10/31/11   206077   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/25/11  00507          DELIVERED   9/25/11  80350

                TALSMA                              BORDENS

                HICO, TX                            DALLAS TX  75215

                B/L 5                               B/L 5

                P/O 1086577                         P/O 1086577

                TRUCK    79149   TRAILER T109

                MILK                                49160   LBS

                HAULING                            491.60   CWT         .650     319.54

                DEMURRAGE                                                        202.50

                W/T @ UNLD

                ROUTE 8107

                    •   $522.04  TOTAL FOR LOAD MI   304378 03 MI  * * * * * * * * * * * * * *

                                                                                      $522.04

       

       

       

       

                                                                  10/31/11   206078   1

                                                                  TAX ID # 74-2539418

       

       

       

               BORDENS                              80350

               5327 S LAMAR STREET

               DALLAS TX  75215

       

       

       

       

       

       

       

                PICKED UP   9/25/11  00507          DELIVERED   9/25/11  01031

                TALSMA                              KELLERS/DFA

                HICO, TX                            WINNSBORO TX   75494

                B/L 7                               B/L 7

                P/O 1084555                         P/O 1084555

                TRUCK    437     TRAILER T276

                MILK                                49800   LBS

                HAULING                            498.00   CWT         .650     323.70

                DEMURRAGE                                                        517.50

      9/26/11  OUT OF ROUTE MILES                    101   EA          .210     212.10

      10/26/11  FUEL SURCHARGE-OUT OF ROUTE           101   EA         1.02      103.02

                W/T @ UNLD

                1ST STOP DALLAS 5.5 HRS

                2ND WINNSBORO 10.00 HRS

                REJECTED FOR SEDIMENT

                ROUTE 8107

      /CODE

        • Trapping Help
          KeyserSoze _

          Those challenges tend to benefit from the "guru trap" method of modeling. This technique is pretty well documented in this forum.

           

          For your sample I was able to build a working model including a summary showing Hauling, Fuel Surcharge, Out of Route Miles and Demurrage amounts in just about five minutes.

           

          I used the PICKED UP line as the detail trap for that template (an eight line template). This template captures the Hauling amount.

           

          Then I set out to add append templates for the other charge types. Those were one line templates, and each used the text PICKED UP for the trap. The trick is to use the descriptive text in the Advanced tab of the field painted, specifically the Preceding String feature. So "demurrage" is shown as the preceding string value, for example.

           

          Finally I added the customer name and location data using a Page Header template, and whipped up a summary using CusName as a key field and each amount field as a measure.

           

          HTH.

            • Trapping Help
              Steve Caiels

              [SIZE=3][/SIZE][/FONT][FONT=Calibri][SIZE=3]Hi,[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]The preceding string advanced field option works well forthis type of report. I think that might also be what the guru trap is based on,but here is another option for you.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Create a detail template as normal, for example a 22 linesample from the TAX ID to the Hauling line.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Trap on something suitable, tax ID for example.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Highlight all the static fields such as Tax ID, Truckdetails, milk and Hauling fields.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Here’s where it gets a little off the normal route.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]To explain what is happening, double click the Hauling fieldthat you have highlighted and go to the advanced field options.  Type an inconsistent field name into the ‘Precedingstring’ option.  For example DEMURRAGE.  When you click OK, you’ll see the highlightjump down to the DEMURRAGE line if it is there. Check out the table and you’ll see the correct data.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]You’ve now lost the Haulage data of course, so remove the precedingstring option to get it back. /SIZE[/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]You can now use the guru trap technique which involves additionaltemplate(s), or you can use the free space you already have in your detailtemplate.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]For example, there is some spare space on a blank line rightunder the Tax ID.  In the detailtemplate, highlight a lump of free space that lines up with the numbers in the TaxID field, but make sure you use the line below Tax ID. Go to the advanced fieldoptions and type DEMURRAGE into the preceding string and the field will snapdown to the correct line.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Repeat this process on any spare lines you have to capture theother fields.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]A Page Header template wouldn’t hurt on the date line,especially if you are considering, or already have Data Pump or ES to burst outthese tickets and distribute them via email or a web browser.[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Regards,[/SIZE][/FONT]

              [SIZE=3][/SIZE][/FONT]

              [SIZE=3]Steve.[/SIZE][/FONT]

                • Trapping Help
                  Grant Perkins

                  Keyser and Steve have explained the 'Guru Trap' components well.

                   

                  The Guru Trap alone is a way to ensure that Append Fields get reset for each new detail record.

                   

                  In many cases this need comes about because some part of the 'detail' of a record is, for analysis purposes in Monarch terms, 'misplaced' in the report or simply awkward to deal with if the report is a little inconsistent in the way that it presents.

                   

                  The preceding string functionality is often the second part of the solution to the above problem since that sort of report will frequently have been created BECAUSE the fields being reported are not always present or not always in the same place or both.

                   

                  2 things to be careful about.

                   

                  On the template definition you should not make the number of sample lines greater than the smallest number of report lines (including an blank lines) between the shortest of your detail record blocks. If the append template 'covers' a detail template start point at any point in the report you will likely get unexpected results.

                   

                  For the preceding strings just remember that they need to be unique.

                   

                  For example if you have, say, 3 fields tagged on the line as

                   

                  Date one

                  Date two

                  Date three

                   

                  as fields to capture ....

                   

                  If your preceing string is entered as 'date' you will only ever see the values from Date One.

                   

                  If these 3 fields do not always all exist then 'date' alone will return whichever is the first that does exist.

                   

                  If you always have three fields but they can appear in a different order within each detail record then you will get the date from the first of the fields Monarch come across as it parses the report lines.

                   

                  So use the full 'tag' or as much of is as is required for uniqueness.

                   

                  If you are unfortunate enough to have the following;

                   

                  Date

                  Date One

                  Date Two

                   

                  You may need to consider using a string that also defines spaces. So "date" may well be unique enough to work. (Sorry, had to present it like that since the forum eviewer seems to compress multiple quoted spaces in read mode.)

                   

                  There are other approaches if things get really tricky with a particular report but they are rarely needed so probably best left for future posts as and when the need arises somewhere.

                   

                  HTH.

                   

                   

                   

                  Grant