ACL Character Function – Include() Function

Welcome back future ACL data analyst. We continue with the series of post for Audit Command Language for beginner data analysts. The next character based function in audit command language is the Include function.

Just like any other function in the Audit Command Language, this is an equally important function. Just like the Exclude function, this function is most often used for the purposes of data cleansing. The difference between the two can be deduced by the names themselves. Nevertheless, to put it in context, there are cases where the requirements are such that only certain characters in the field may be required for a certain analysis. For instance, there may be account numbers in a ledger where alphabets are just added for identification purposes but for overall reconciliations, the actual account number is to be considered. In such cases, only numeric values are required to be ‘included’ in the final formatted data.

Syntax: Include(Data Field or string,<Characters to include>)

Example in a script to create a new field using Include Function

DELETE FIELD NEW_GENDER OK
DEFINE FIELD NEW_GENDER COMPUTED AS
Include(FIELD_1,’M’)

Example in a workspace to create a new field using Exclude Function

NEW_GENDER Computed
Include(FIELD_1,’M’)

The above examples are attempting to include only the character ‘M’ in the gender field in the existing table and create a new field. See the below screenshot for the result.

It really is as easy as it looks. There shouldn’t be any real challenges here for anyone and it is a nifty trick to be able to use to impress your first boss to help him/her with data cleansing. So keep an eye open for any such opportunities.

Please keep practicing and feel free to reach out to us with your valuable feedback and comments. Please go to the website to review ACL script examples and ACL commands sign up for our newsletter, so that we may keep you posted on the latest activity on our website and Youtube channel.