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

    Help with Floating Trap

    francisco _

      Good morning!

      For some reason when I select three lines for my sample text and I create a trap for each line, only the one I left selected is formated right! The other two are not.

      Please see the sample below:

      The three lines I am selecting are

      N1ST......

      N3*....

      N4*....

      N3 & N4 are just the only one after the N1ST line. (Note that there is another set of N3 and N4 after the N1CN) These should be ignored.

       

       

      [SIZE="2"]ST940000030364~                                                                               

      W05N01-320309LP895861638*01-320309-001~                                                                  

      N1CNLUGGAGE N LEATHER/LUGGAGE PROS92LUG148~                                                              

      N313779 RIDGEDALE DR~                                                                               

      N4MINNETONKAMN*55305~                                                                               

      N1STBILGEHAN  ERMAN92ERMAN~                                                                               

      N32  CHESTNUT COURT~                                                                               

      N4MARLBORONJ*07746~                                                                               

      N9ZILUG1~                                                                               

      G620220090529~                                                                               

      G621020090527~                                                                               

      G625220090527~                                                                               

      G629920090626~                                                                               

      NTETRANO SPECIAL INSTRUCTIONS~                                                                             

      NTEBOLThird party add:-1409 Fairfield Rd-Minnetonka,MN 55305~                                              

      NTESPHAccount 737W04~                                                                               

      W66TPU***UPSN~                                                                               

      LX*1~                                                                               

      W011EA051243014347VN*407062502~                                                                          

      LX*2~                                                                               

      W011EA*VNDROPSHIP~                                                                               

      W76*2~                                                                               

      SE23000030364~                                                                               

      ST940000030365~                                                                               

      W05N01-320803LP902491638*01-320803-002~                                                                  

      N1CNLUGGAGE N LEATHER/LUGGAGE PROS92LUG148~                                                              

      N313779 RIDGEDALE DR~                                                                               

      N4MINNETONKAMN*55305~                                                                               

      N1STJANELLE   REINEKE92REINE3~                                                                           

      N311625  NORTH  65TH  AVENUE~                                                                               

      N4GLENDALEAZ*85304~                                                                               

      N9ZILUG1~                                                                                /SIZE

       

       

       

      Thank you!!!!!

        • Help with Floating Trap
          Data Kruncher

          If you use "n1 st" as your detail template trap (using a 3 line sample) you should be alright, painting N1 N3 and N4 as three separate fields.

            • Help with Floating Trap
              francisco _

              Thank you for the suggestion.

              The thing is that I already have the detail templete used for another field and I think you can only use one detail temple per model.

              I detail templete I used was for the LX and W01 lines whicj are basically the

              detail lines of the order.

              Any other suggestion?

              Thank you

                • Help with Floating Trap
                  Data Kruncher

                  If I understand the layout correctly, then two templates are required. First, a two line detail template with LX as the trap, painting the LX line and the W01 line as separate fields.

                   

                  Next, the three line append, using "N1" as the trap, painting the three lines for N1, N3 and N4 as separate fields.

                   

                  This will result in capturing two records in the table for each of LX1 and LX2, and each record will have the N fields for the Chestnut Court address in Marlboro.

                   

                  Is that what you need, or am I missing some other information?

                    • Help with Floating Trap
                      francisco _

                      Your are correct!!

                      The problem is on the append templete. See when I select the three line (N1, N2, and N3) I set the trap in Line 1 for N1 (I had to select a floating trap, though) and enter "N1ST               ", then I use the scroll to move to the second line. Here I have to write: "N2                   ". I do the same for line 3: "N3          *  *". For each line I select or highlight the fields: Name for line 1, addres for line 2, and for line 3 I select city, state and zip code.

                      The problem is that each time I scroll to eather one of the lins, I lost the trap

                      for the other two.

                      So they look like this:

                       

                       

                      N1STBILGEHAN  ERMAN92ERMAN~

                      N32  CHESTNUT COURT~             *<--the highlighted area is up to the  *

                      N4MARLBORONJ*07746~                <--here it's ok

                       

                      but I have to leave the trap in line 4 so I can get the city, state, and ZC right, othewise if I move trap line the highligethed areas shift and I loose the

                      correct areas.

                      How do I make it to remember the traps for each line?

                       

                      Thank you

                        • Help with Floating Trap
                          Data Kruncher

                          Monarch cannot successfully use a floating trap in that manner.

                           

                          Instead, we must take the approach of painting each of the lines as one large field, and then build calculated fields to properly extract the various parts that make up the large field individually. Slice and dice, as it were.

                           

                          To do this, we'll use the LSplit function, using the * to break up the larger string.

                           

                          The first step is to determine how many pieces make up each line. Including the N#, the N1 lines are made up of 5 fields. N3 has 3 fields, while N4 has 4.

                           

                          FullName is:

                          LSplit(N1,5,"*",3)[/code]The 92 value needs:

                          LSplit(N1,5,"*",4)[/code]LName, which I assume you want without the ~ character, uses:

                          Strip(LSplit(N1,5,"*",5),"~")[/code]Address needs:

                          LSplit(N3,3,"*",2)[/code]City is:

                          LSplit(N4,4,"*",2)[/code]State is:

                          LSplit(N4,4,"*",3)[/code]And finally Zip is:

                          Strip(LSplit(N4,4,"*",),"~")[/code]You can handle the LX and W lines in a similar manner.

                           

                          Kruncher

                            • Help with Floating Trap
                              francisco _

                              That sound and look great!!!!

                              My only question is where do I entered these functions?

                              Do I just highlight the entire field and create a new calculated field where I can use the functions?

                              or they have to be used somewhere else?

                              Thank you

                                • Help with Floating Trap
                                  francisco _

                                  Never mind!

                                  I figured it out!

                                  It was as I thought it was!!!!

                                  Your are so great!!!!!!!!!!!!!

                                  Thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                                    • Help with Floating Trap
                                      francisco _

                                      There's one more thing I would to ask,

                                      The NTE's are notes.

                                      Some of them will repeat more than one Z01 for example:

                                       

                                      NTETRANO SPECIAL INSTRUCTIONS

                                      NTEZ015292509  20090427-20090507 2 4.64 21.2~

                                      NTEZ015310119  20090511-20090521 1 2.32 10.6~

                                      NTEBOL'Third party add:-1409 Fairfield Rd-Minnetonka,MN 55305~

                                      NTESPHAccount 737W04~                                        

                                       

                                      Each NTE is part of one record. There is no problem when there's one instance of eachc NTE, but when one repeat more than one, only one (the last one) is the one writen.

                                       

                                      Thank you

                                        • Help with Floating Trap
                                          Olly Bond

                                          Hi francisco,

                                           

                                          Which one of the Z01 lines you pick up will be determined by which template type you use.

                                           

                                          If you have a detail template that appears below the Z01s, and the Z01 is captured with an append template, then only the last Z01 will appear.

                                           

                                          If the detail is above the Z01 and the Z01 is captured with a footer template, the first Z01 only will appear.

                                           

                                          Basically, Monarch makes one line in the table for each appearance of the detail template, and data from the nearest append, footer and page header templates is attached to that line.

                                           

                                          This is fine for most needs, but when you have multiple levels of detail - like here, where for each record you want to have potentially many Z01s - then you have three options:

                                           

                                          1. Make the Z01 template the detail template, and change the other detail template to append or footer as appropriate.

                                           

                                          2. Build a mulit-pass process with several Monarch models that extract different bits of data and then join this using Monarch's external lookup function.

                                           

                                          3. Consider using XML instead of a table to store the output data, and have a look at Monarch's sister product VorteXML.

                                           

                                          Best wishes,

                                           

                                          Olly

                                          • Help with Floating Trap
                                            Grant Perkins

                                            There's one more thing I would to ask,

                                            The NTE's are notes.

                                            Some of them will repeat more than one Z01 for example:

                                             

                                            NTETRANO SPECIAL INSTRUCTIONS

                                            NTEZ015292509 20090427-20090507 2 4.64 21.2~

                                            NTEZ015310119 20090511-20090521 1 2.32 10.6~

                                            NTEBOL'Third party add:-1409 Fairfield Rd-Minnetonka,MN 55305~

                                            NTESPHAccount 737W04~

                                             

                                            Each NTE is part of one record. There is no problem when there's one instance of eachc NTE, but when one repeat more than one, only one (the last one) is the one writen.

                                             

                                            Thank you[/quote]

                                             

                                            francisco,

                                             

                                            Is this an EDI file?

                                             

                                             

                                             

                                            Grant