4 Replies Latest reply: May 15, 2014 9:57 AM by Grant Perkins RSS

    Extracting only summary pages

    Markco _

      New to Monarch. Trying to extract only summary pages (18) scattered throughout a sales report (400 pages). Each summary page is by Sales person and is a single page at the end of their detail section. I think I have a unique, or close to unique, way to identify the pages but can't see how to then get the entire page as this only identifies a line on the page. This seems like it should be straight forward but, as I said, I'm new to Monarch and I sure don't see it. Any help for the newbie would be appreciated.

       

      Thanks

        • Extracting only summary pages
          Grant Perkins

          Hi,

           

          There are two separate concepts to recognise here, namely the TEMPLATE and the TRAP.

           

          The TRAP allows you define a unique (hopefully)line which occurs one or more times in the document.

           

          The TEMPLATE is something that connects the TRAP to the SAMPLE LINES and which defines a line or a number of lines - some possibly above the trap line - where the data you want to extract are stored. It also contains the definitions for the fields to be extracted.

           

          For most reports it is likely that the number of lines allowed in the SAMPLE would cover a complete page. Therefore is you summary does not cover more than a page you should be able to map the fields on the summary page within a single SAMPLE.

           

          I suppose it is possible that the summary page has multiple summary sections in which case your trap needs to allow you to work within the number of lines in each section.

           

          It the summaries have variable contents - in terms of either the number of lines or the order of the lines which might be different on some pages - there are some additional and interesting approaches possible. Indeed it is possible to identify and select data from report pages without including all of the lines in the sample section providing the data required can be identified by a consistent and unique preceding string. (A form of tag or label indicating what the following data is.)

           

          See where you get to with the SAMPLE, TRAP and TEMPLATE information above. If you then find there is a problem with variability in the layout of the summary pages we can move on to the more advanced (meaning trickier!) options.

           

          Have fun.

           

           

          Grant

           

          PS - For future reference, which version of Monarch do you have access to?

          • Extracting only summary pages
            Markco _

            Hi Grant!

             

            Thanks very much for your prompt response.

             

            I'm using version 7.

             

            The summary pages (and each one is always just a single page) have 2 distinct summary sections - sales summary by product category and margin summary by product category. The number of lines can vary from page to page. (i.e. if a salesperson didn't sell anything from a given category then that line will not show up in either section.) The summary pages can be identified by a line that has "SALESMAN TOTALS" as it's only text. Here's a rough idea of the page format:

             

            Header (7 lines)

            salesman id line:  ### Name

             

            "Salesman Totals"

               "Sales"

                  1 'cat1 name'    (10 columns of data)

                  3 'cat3 name'    (10 columns of data)      

                    etc

                "Total Sales"      (10 columns of data)

             

                "Margin"

                  1 'cat1 name'    (10 columns of data)  

                  3 'cat3 name'    (10 columns of data)

                    etc

                "Total Margin"     (10 columns of data)

             

            The total margin line is ended with a form feed only - no newline.

             

            I also need to filter by salesman id but I assumed I could do that in table view once I have my information. Oh, and I need the header - why make it simple.

             

            I have been working with traps and templates to get the data I want. One of the difficult areas I have run into is that the product category line format is used in the detail sections as well as the summary sections so I have had trouble filtering out those detail lines so I only have the summary lines.

             

            Thanks again for your help.

             

            -mark

            • Extracting only summary pages
              Bruce _

              Mark

               

              Just a thought to try a different spin on things. Take with a grain of salt as I am not sure what you're trying show show as the final result. Perhaps a pseudo-report showing what you need to see would help.

               

              Trap only on the salesman DETAILS and ignore the summaries from the report. Then use monarch to calulate the required summaries or totals for each rep.

               

              This way you can show totals broken out by several different methods (sorted by region, fltered by country, ranked by sales to date, etc, etc). This is the power of Monarch and will allow you to do more than the summaries the programmer made for your sales report.

               

              Monarch does take some time to learn (a lot less than many softwares), but is worth it. Take the included tutorials and play with them. These were very helpful when I started.

               

                 smile.gif[/img]

              • Extracting only summary pages
                Grant Perkins

                Hi Mark,

                 

                It sounds like separating the detail detail from the summary detail using a template trap could be challenging and I think I agree with Bruce's suggestion though I would guess that your detail detail lines maybe don't include the sections for margin calculations? If they do so much the better.

                 

                To have the split would, presumably mean that your full detail section per sales person would have a section with a number of lines for individual sales transactions (also with 10 columns matching the summaries?) followed by another section with margin details and then the Summary page you want to get at.

                 

                In that case, and with the difficulty in selecting rows from the summary page only, it seems that this may be a job for the V7 Multi Column Region functionality.

                 

                In outline something like this:

                 

                Select a row with 10 columns. I think you can already trap these rows. Don;t worry about whether it is a summary page at this point. Define the MCR to suit the row and 'paint' the field in column one of the MCR region. Also paint a field for the Product Category at the beginning of the line. Make this the detail template.

                 

                Create and APPEND TEMPLATE that applies WITHIN THE MCR to pick the column heading field - I assume there is a heading.

                 

                Create an APPEND template that will trap and extract the "Sales" and "Margin" section headers. ( I am assuming there is something on the report where you have indicated the headings ...).

                 

                A further template to pick the "Salesman Totals" text would be good IF THERE IS A SECTION OF THE DETAIL REPORT THAT CAN ALSO BE PICKED UP BY THE TEMPLATE. What I would be trying to do is use this text to filter records relating to the summary pages. So we are looking for a field that will always exist at the top of a collection of detail records - whether they are detail detail or sumary detail. The field could be empty of contain garbage - it doesn't matter. We just need to be able to use it ti filter.

                 

                Add the Salesman ID line details as a further APPEND and then the Page header lines as a page header and include any fields you need from there.

                 

                Now, if all of this loks like it may work out, it is likely that you need to defined the start and finish boundaries of the MCR sections of the pages. You can do this by specifying where the MCR begins and end related to the templates in the model. If necessary dummy templates can be created to help with the task where no real templates are suitable.

                 

                Bear in mind that this is not really trivial activity to be involved with as a new to Monarch user! One of the more confusing things about multi column reports is that we see a page as a page whereas we need to think of it as Monarch does - a 10 column report is really a narrow single column report of many rows.

                 

                If you are in a position to provide a sample of the report - both the detail and the summary sections - by email I would be happy to see what can be done with it and send a model. I often find that it is easier to work out how something can be done by looking at existing approach to the solution. If you are interested in doing that let me know and I will send you a PM with my email address.

                 

                I hope the suggestions above make some sense - it is actually a little easier to to create the model (if it is possible) than to write a description for guidance!

                 

                Have fun,

                 

                Grant