Writing efficient and effective scripts in ACL data analytics software requires a combination of knowledge, experience and creativity. This is what makes scripting in ACL data analytics so much fun (and why I love it so much). You can solve extremely complex problems using ACL’s powerful and flexible scripting language, however depending on how you achieve your result; there could be a performance price to pay. Since there is usually more than one way – and often many ways – of getting the same result, it is always important to consider all the possible methods before deciding on a solution.
Script performance has become a hot topic in Support lately and can vary largely depending on the design of your script. I have put together a list of tips and tricks for optimizing script performance and will go over them in a series of posts.
This being my first post, I chose to cover the all-important GROUP command.
Using the GROUP command
You are probably saying to yourself “Using the GROUP command? That sounds pretty simple”. Good news…it is!
People often forget about this command or they use it exclusively for complicated GROUP – IF – ELSE combinations. While you can do some really creative things using the GROUP command (possibly a good topic for another time), where it really shines is running multiple commands on a single table at the same time. This will help save you valuable processing time as you strive to cut down on your scripts run time.
Here is a simple example where I extract different company codes to separate tables.
Since we enclose the EXTRACT commands inside a group, ACL data analytics will only need to read the table a single time and will extract each table as it goes through the records. Without the GROUP command, ACL data analytics would need to read the table six times, once for each extract. This provides significant bonus in processing time.
Another good application of the GROUP command would be to run multiple commands on the same table (Example: CLASSIFY, STRATIFY and SUMMARIZE).
Next time we will look at how computed fields can slow down your processing time and what you can do to avoid it.