Welcome back to the blog series ‘Audit Command Language Tutorials for Beginners’. At this stage in the series, we are discussing the numerous character functions that are available in the Audit Command Language to manipulate and transform character fields.
In this post, we are going to take a look at the ALLTRIM function. This function solves a problem that is more often than not, the root cause of most issues faced while performing any analysis. To get correct results from most functions, it is critical that all extra spaces (leading and trailing) are removed from the field before any transformations are executed. Consider applying the Sub function, if there are leading spaces. You would never the get the correct output. Essentially, the ALLTRIM function helps to normalize/standardize the raw data fields to allow for accurate transformation.
Example in a script to create a new field using Alltrim Function
DELETE FIELD TEST_DESCR OK
DEFINE FIELD TEST_DESCR COMPUTED AS
Example in a workspace to create a new field using Alltrim Function
The result from both the above applications of this function would basically return the values from column ‘TEST_DESCR’ without any leading or trailing spaces. There may not be a visible difference in the resulting column as shown in the screenshot below:
As the screenshot shows, there isn’t any noticeable change in the resulting column. However, it is prepared for any further transformations with accurate results. Now you have seen enough of character functions till this point to be able to use them in your own projects to see a significant impact. See the video demo below:
Please keep practicing and feel free to reach out to us with your valuable feedback and comments. Please go through the website to review ACL script examples and ACL script commands sign up for our newsletter, so that we may keep you posted on the latest activity on our website and Youtube channel.