• Home
  • Contact
  • Find a Partner

Contact ACL: 1-888-669-4225
facebook
linkedin
twitter
vimeo
youtube
email

  • SOLUTIONS
    • Products
      • GRC
      • Enterprise Continuous Monitoring
      • Data Analysis
    • Departments
      • Internal Audit
      • External Audit
      • Compliance
      • Finance
      • Shared Services
    • Hot Topics
      • FCPA + UK Bribery Act
      • Fraud
      • Risk
      • SAP® ERP
    • Industry
      • Banking & Finance
      • Business Services
      • Education
      • Government
      • Healthcare
      • Insurance
      • Manufacturing
      • Telecommunications & Utilities
      • Retail
  • SERVICES
    • Training
      • Course Catalog
      • Training Schedule
      • ACDA Certification
    • Services & Support
      • Consulting Services
      • Support Services
  • CUSTOMERS
    • Customer Community
      • Connections Customer Conference
      • User Groups
      • ACL Bootcamp
      • Impact Awards
      • Support Center
      • Social Media
    • Customer Successes
      • Case Studies
      • Customer Reference Program
  • ABOUT ACL
    • Company Overview
      • Contact
      • News Releases
      • Media Coverage
      • Analyst Coverage
      • Careers
      • Management
      • Legal
    • Engage
      • Events
      • ACL Blog
      • Subscribe
      • Education Futures
      • Social Media
    • Partners
      • Find a Partner
      • Associations
  • RESOURCE LIBRARY
    • Case Studies
    • Webinars
    • Videos
    • Podcasts
    • Product Collateral
  • SUPPORT CENTER


Optimizing Script Performance Part Three – Keyword Searches

January 23, 2013
by Kevin Legere
ALLTRIM, AT Function, Keyword Searches, Scripting
3 Comments

Previously we looked at how you can improve script performance with some simple (yet often overlooked) commands. In case you missed the earlier posts on Optimizing Script Performance, read Part 1 and Part 2.

Greetings scripters!

Today, I would like to touch on a slightly more advanced topic and look at keyword searches using ACL Analytics. Like most things in ACL, there are usually more than one way to attack a problem—the same can be said when searching a table a field for a list of keywords. Here are some tips to help you achieve faster results:

1.    Use the ALLTRIM function

You might be asking “Why would I need ALLTRIM() in keyword searches?” The answer is simple. Large free-form text fields can contain a LOT of empty space and using ALLTRIM will limit how many bytes of data you need to search, thus saving you valuable processing time. Nesting ALLTRIM within the FIND function will eliminate leading and trailing spaces so that you are only searching the visible data. Let’s say that we want to search a comment field for the keyword “Gift”. Here is an example of what this might look like in ACL:

Kevin Pic1

Here is more info on the FIND function

2.    Use the AT Function instead of FIND

Someone recently showed me a great trick – using AT instead of FIND can reduce your processing time by more than 50%! This was surprising to me at first until I realized that FIND is case-insensitive, which means it has to check for every combination of upper and lower case.  Since AT is case sensitive, you can nest the UPPER function with it and get the same results. Here is what the previous example might look like if we use AT instead of FIND:

Kevin Pic2

Here is more info on the AT function

3.    Avoid the use of conditional computed fields

The above example works nicely if you want to search a field for one word. But what if you have a list of 200 hundred words?  The very first way I tried this (and I see many others make the same mistake), I created conditional computed fields using the FIND function and a different keyword in each condition. There are some issues with this approach:

  • It takes a very long time to complete
  • The keyword list is hard to manage
  • You won’t know if multiple words are in the same field as only the first match will be captured

 

In my opinion the easiest and most efficient way to do a keyword search is to:

  • Create an Excel (or Text) file with a list of your keywords
  • Import the table into ACL
  • Perform a ‘fuzzy’ JOIN between your data and keyword tables. If you don’t know to do a fuzzy join, check out our knowledge base.
  • Use AT or FIND in the IF condition of the JOIN to filter for keyword matches

 

Let’s say we have a table called “My_Keywords” with keyword field called “Keywords” and a data table called “My_Data” with a field “Comments” we want to search. Our code would look something like this:

Kevin Pic3

The resulting table will contain all records where it found a keyword match and the word it matched on. Note that PRESORT and SECSORT are not required during a fuzzy JOIN since we are essentially matching everything in one table to everything in the other table.

Hope you found this helpful and stay tuned for more tips. Happy Scripting!

Powered By DT Author Box

Posted by Kevin Legere

Kevin Legere

Kevin Legere is an Implementation Consultant with ACL Professional Services Group where he has experience providing clients with custom script solutions, technical guidance and data analysis in a variety of business areas. In addition to ACL, Kevin has experience in data analysis and technical design in other roles involving Healthcare, Manufacturing and Software industries. Prior to joining ACL Professional Services Group, Kevin worked in Support Services with the Escalation Team at ACL. During this time he provided support for internal and external clients with regards to technical issues, data connections, architecture design and many other areas. Kevin has a Bachelor of Science in Mathematics and Statistics and is an ACL Certified Data Analyst (ACDA).

Social Share
3 Comments
  1. Mortisha Brown February 8, 2013 at 6:00 am Reply
    I have read all, from Part 1 - Part 3. This is very interesting. Thanks for sharing this essential piece of information. I really learned something from you.
  2. Satchin March 4, 2013 at 12:38 am Reply
    Hi Kevin, Thanks for the info here. Can you please clarify your Join command in the example above: It uses a filter where the the 2 table been joined, are also related: Open my_data Secondary and my_data.Comments? ACL Desktop (V9.3) will not show the table as a Secondary Table if they are already related. Regards, Satchin
    • Kevin Legere March 5, 2013 at 2:41 pm Reply
      Hi Satchin, When doing a Many-to-Many join ACL will allow you to use fields from both tables in the filter. This is what helps make a fuzzy Join so powerful. Thank you, Kevin

Leave a Reply Cancel reply

*
*

Categories

  • All Blog Articles
    • Auditing
    • Business Assurance
    • Compliance and Risk
    • Continuous Auditing/Monitoring
    • Fraud Detection and Prevention
    • Internal Audit
    • Management
    • Technology

Contact Us

  • Products
    • Enterprise Continuous Monitoring
    • Data Analysis
    • GRC

Latest Tweets

  • Breaking Down Silos and Building Up Enterprise #Compliance bit.ly/10nh2tg @complianceweek #regulations 15 hours ago
  • Q&A with Hal, IT Audit Director at @DnBUS. Hal talks about what it means to be a "controls activist" acl.com/portfolio/qa-w… 16 hours ago

Subscribe

Sign up to receive email updates from ACL.

SUBSCRIBE

Recent Posts

  • "How would you kick start data analytics?" ACL LinkedIn Group
  • ACL Launches ACL™ Analytics 10; Powerful Analysis Software Enables Data-Driven GRC Management
  • ACL Selected As Finalist For BCTIA Technology Impact Awards

t: 1-888-669-4225 e: info@acl.com | Terms and Conditions
© 2013 Copyright ACL Services Ltd.

mongoose

ACL Analytics