Put some nice smelly cheese into a trap, and you might catch a mouse. Put the right trap into a Monarch template and you’ll capture your data.
On day 2 of the 30 Days to Become a Better Monarch Modeler series we’re going to review the tools that are Monarch makes available to us to let us teach it where our data is hiding.
Many software tools are available for handling databases, and Monarch Pro can perform that work as well as or better than many others, but its real specialty is report mining: extracting data from report files and in the process converting them from static documents into dynamic tools for business intelligence.
Central to being able to extract report data is the ability to differentiate the data to be extracted from the rest of the report. Monarch refers to this as trapping the data. You use special controls or characters to direct Monarch to isolate key fields from the remainder of the report.
|Replaces the text in the sample line with the currently selected rows in the report window. This is often useful when multiple fields are required within a row, but not every field is populated within each row.|
|New to Monarch v10 is the ability for Monarch to generate the traps for you. This is activated by selecting the Auto Define Trap wizard.|
|Use the Alpha trap to tell Monarch that you want to include rows which have an alpha character (a-z) in the selected position.|
|Use the Numeric trap to tell Monarch that you want to include rows which have a numeric character (0-9) in the selected position.|
|Use the Blank trap to tell Monarch that you want to include rows which do not have any characters in the selected position.|
|Use the Non-blank trap to tell Monarch that you want to include rows which have any character (a-z, 0-9, or any other symbols) in the selected position, so long as the selected position is not blank.|
|Often used in multiple positions the Numeric OR tells Monarch that you want to include rows that have numeric values (0-9) in either this position OR that position OR that position OR …|
|The Postal trap inserts <ZIP> into position 1. When you use the Postal trap, all of the fields that you define must align vertically; they must begin and end on the same positions within the row.|
|The NOT toggle will reverse the functionality of the selected trap character(s). The trap characters will appear in red with a strikeout font. Effectively, this tells Monarch to include rows that do not have the selected trap in this position.|
|Clicking the Reset Trap icon will remove any traps that have been added to the trap line.|
|The Auto-Define Fields icon will paint all of the fields that Monarch detects in the sample area. The data types will be automatically assigned based on the content of the field. Monarch does a very good, if not always perfect, job of detecting fields.|
|When the cursor is in the painted area of a field in the sample area, the Field Properties icon will be available to you. Of course, you could just right-click or double click the field to bring the up field properties dialog.|
|When the cursor is in the painted area of a field in the sample area, the Reset Selected Field icon will erase the selected field.|
|The Reset All Fields icon will erase all of the painted fields in the sample area. After your confirmation, of course.|
|Clicking the Pull Left and Push Right icons will move either traps or fields over one position, depending upon whether the cursor is in the trap line or the sample line. A nice enhancement to v10 is that the shifting acts slightly differently depending on the cursor location. If it’s within a field, only the selected field will move. If however the cursor is between fields, all of the painted fields will shift. This enhancement makes editing templates a snap.|
Additionally, you can supply literals as trap characters. So if you know that you need to include all rows that have the string “CUSTOMER:” starting in position 1, then type CUSTOMER: into the trap line.
By the way, Monarch won’t interpret the word CUSTOMER: as a word. Instead, it looks at the characters individually: a C in position 1, a U in position 2, an S in position 3, and so on, up to the colon in position 9.
Use as many trap characters as necessary to have Monarch properly isolate your data from the remainder of the report. Your trap line can include a combination of characters inserted by using the buttons and characters that you supply manually.
Additional trap options
Under the Options menu you’ll find Input options for further control of the trap facilities. You can choose to make your trap characters case sensitive so that a trap that reads “CUSTOMER” will ignore occurrences of “Customer”. You can also choose to use a different set of characters for the traps generated by the buttons, such as Numeric or Alpha traps, by selecting the “Alternate” trap characters instead of the “Standard” ones. People often use the alternate characters when they intentionally want to trap on characters that exist in the report that Monarch normally uses for trapping purposes, such as the vertical bar, or pipe character “|” which Monarch uses for detecting numeric OR conditions.
Monarch v10 users can take advantage of a feature not available in earlier versions. New to v10 is Monarch’s ability to build the trap line for you. Hardened Monarch veterans might say that this is akin to removing the art from the science.
But just as we can drive our vehicles from A to B, it doesn’t mean that we all understand what’s going on under the hood. But sometimes the vehicle breaks down, so it helps to have a bit of knowledge about how it works and where things are. So you v10 users (especially the new-to-Monarch-with-v10-folks), don’t get too reliant upon the tool. Learn how to trap on your own and you’ll thank yourself one day.
Your task for today
Get comfortable with Monarch trapping tools. Spend at least 30 minutes with a somewhat complex report experimenting with different ways to capture different data sets within the report. Start by capturing as many similar records as you can – all of the rows that you would consider details – and then narrowing the data selected not by using filters but by only changing the traps. Practice until you can correctly select the proper trap tools as easily as you can type your name.
Trapping is critical
Many years ago when the exploration of the world was just beginning, trappers were not just looking to survive, but were often key players for international trade. Being a good trapper today can be of equal importance and is absolutely necessary if you want to excel with Monarch.