3 Replies Latest reply: May 15, 2014 10:14 AM by Olly Bond RSS

    Two Templates

    beadzoo _


      Looking for help on building a model that will use two different templates to capture data for a report that has an upper section with 5 columns, then a lower section with only 2 columns.


      I want to capture the far right column of the top section, but then in the 2nd section capture two different columns not aligned with the top section.


      I can't get the table data to display correctly, and have put the detail template to capture the lower data, with an append template capturing the top table.

        • Two Templates
          Grant Perkins

          Does you report have both layouts togehther and repeated for each 'record' or is it the type of report that has 2 complete sections  - the first xxx pages being in one format and the second xxx pages in another format?


          Monarch works with a single template and a single detail record oer resulting output table 'record'. There many ways to look at a report's information lines and convert them into single records but the best method for an individual report may be very specific to that report. Examples of the input are always useful. Would you be able/allowed to post a sample of the report format (real or 'cleaned up providing cleaning up does not lose anything that might be useful for trapping and filtering) to make it easier for us to see the problem?


          Most reports can be made to succumb to a single model definition provided it can be structured using a single 'detail' record base for the extraction.


          There are some exceptions whereby the report needs two models and two porcesses to extract the information and a third process to combine the two extraction back into a single output. Monarch allows for this multi-stage to be automated in a number of ways. We can get to that if we need it. It would normally be something for the 'two reports in one output file' type of report rather than a complex single record format that repeats for each record.


          In very extreme cases there may be way 2 extract multiple types of 'detail' as a single model extraction and then split it up and manipulate it afterwards. In effect this would be the same as running two models but there may be benefits to running a single extraction process.


          The key is to be able to visualize what you are presented with, see which parts are important and then how they should look when delivered after extraction. Then it's just a matter of breaking that down and identifying the right Monarch tools and approaches to fill the gap between input and output.






            • Two Templates
              beadzoo _

              Hi Grant,

              Thank you for your reply. I am providing  copy of the report below. This report is truncated, however displays sections that I am only interested in mining anyway.


              I would like to mine two sections:

              The "TOTAL" column in the "COSTS" section

              The "TOTAL" column in the "NUMBER" section


              At the present moment I am using two models, and would like this reduced to one. Thanks for reviewing this. I really appreciate it.



              USER COMMENT     :



              COSTS                               DTW         JFK         MEM         MSP       TOTAL

              synthetic                    12.3639680   7.7112116  12.7486910   6.7324375  10.6773844

              salary                       1862586.87   637283.72   750420.99   654574.15  3904865.73

              hotel + transportation       1953250.00   690004.40   839880.00   634079.80  4117214.20

              perdiem                       159537.86    54383.30    64870.36    53009.84   331801.36

              deadhead and ground cost      504000.00   215000.00   117000.00   199000.00  1035000.00

              total cost                   4479374.73  1596671.42  1772171.35  1540663.79  9388881.29



              NUMBER                          TOTAL        COST

              1. patterns                       1645

              2. occurences                     2416

              3. regularity patterns            1638

              4. hotel rooms                    8308

              5. internal deadhead               390       761000.00

              6. cml deadhead                     64       274000.00

              7. grounds                           0            0.00

              8. aircraft changes               5046

              9. duty days                      13204

              10. duties                         11004[/code]


                • Two Templates
                  Olly Bond

                  Hello Beadzoo


                  You can trap the Detail line using the Numeric Or (¦) trap - two should do lined up above the "64" value of the "#cml deadhead" line. Select two fields, "Item" as a Character field that's 25 characters wide, and then "Blob" as a Character field that's wide enough to include all the numeric values. You can trap the Append by using an Alpha trap (Ã) lined up above the "D" of the "COSTS ... DTW" line. Select a field "Section", Character, width 10.


                  Now in the Table, define a calculated field Total as a numeric, two decimal, currency field as follows:




                  val(rsplit(intrim(Blob);2;" ";1));

                  val(lsplit(intrim(Blob);2;" ";1))




                  You can now Hide the field "Blob". This results in:


                  SECTION    ITEM                                     TOTAL

                  COSTS      synthetic                      €106.773.844,00

                  COSTS      salary                         €390.486.573,00

                  COSTS      hotel + transportation         €411.721.420,00

                  COSTS      perdiem                         €33.180.136,00

                  COSTS      deadhead and ground cost       €103.500.000,00

                  COSTS      total cost                     €938.888.129,00

                  NUMBER     # patterns                           €1.645,00

                  NUMBER     # occurences                         €2.416,00

                  NUMBER     # regularity patterns                €1.638,00

                  NUMBER     # hotel rooms                        €8.308,00

                  NUMBER     # internal deadhead                    €390,00

                  NUMBER     # cml deadhead                          €64,00

                  NUMBER     # grounds                                €0,00

                  NUMBER     # aircraft changes                   €5.046,00

                  NUMBER     # duty days                         €13.204,00

                  NUMBER     # duties                            €11.004,00



                  Hope this helps,