3 Replies Latest reply: May 15, 2014 10:02 AM by Data Kruncher RSS

    Is there an Alpha-OR similar to a Numeric-Or?

    bbeadle _

      How do I trap freeform text (much like this message) if I need to check for a non-blank anywhere along a specific width of the page.  I can do this for numeric values using the pipe ("|") character... but is there an Alpha-Or function such that I can say, "if any character between position 20 and 50 is a visible alpha character then trap this line?

        • Is there an Alpha-OR similar to a Numeric-Or?
          Data Kruncher

          Given the lack of Numeric OR type of approach, as you say, this sort of need is usually handled capturing every line, then filtering based on the criteria. It entails a little extra effort, but usually - not always - gets the end result required. It really depends on the report and the specific requirements.

           

          In your case I'd think that a filter with an expression something like:

          Trim(Substr(MyText,20,30))<>""[/CODE]

           

          may do the trick.

           

          HTH,

          Kruncher

            • Is there an Alpha-OR similar to a Numeric-Or?
              bbeadle _

              Given the lack of Numeric OR type of approach, as you say, this sort of need is usually handled capturing every line, then filtering based on the criteria. It entails a little extra effort, but usually - not always - gets the end result required. It really depends on the report and the specific requirements.

               

              In your case I'd think that a filter with an expression something like:

              Trim(Substr(MyText,20,30))<>""[/CODE]

               

              may do the trick.

               

              HTH,

              Kruncher[/QUOTE]

              I've been a Monarch user for many years for over a decade...but have hardly touched it in the past 4 or 5 years and am new to version 9.  You've kind of lost me here...I'm wondering where you would put such a code string?  Is there a dialog box available at the template level where you can do this type of coding?

                • Is there an Alpha-OR similar to a Numeric-Or?
                  Data Kruncher

                  No problem.

                   

                  One you capture all of the data - however you need to do that with the various templates and tools - switch over to the Table window and create a new formula-based filter. Click the toolbar icon with the green and red dots with the three check marks.

                   

                  Give the filter a meaningful name, like Valid Data Only or some such thing. The formula I supplied would go into the Expression box in that dialog box.

                   

                  This sort of approach is often more useful when you find yourself fighting with getting traps just right in your templates to avoid picking up certain item. Sometimes there are items that appear in other rows that match the trap you want to use, but you don't really want/need that particular item, and no matter what you do you can't avoid capturing it.

                   

                  Instead of struggling, just give up and capture it. Then you can generally filter out the rogue item based on some other condition/criteria within the record.

                   

                  Simple numeric lists can sometimes cause this. Imagine:

                  Item 1 200.00

                  Item 2 100.00

                  Item 3 300.00

                         -


                  Total  600.00

                         ======[/code]

                   

                  If you trap on the decimal point or even .NN, you'll get the Total line. In the table I'd filter out the row where the description = "Total".

                   

                  Any clearer?