Creating a script to automate a business process

With growing globalization, evolving markets, and regulatory pressure to improve risk and control environments under rapidly changing business conditions, it is critical that organizations develop continuous monitoring programs. These continuous monitoring programs often require scripts to automate business processes. In this article, we discuss how to create a script in Analytics to automate a business process.

This article illustrates how to automate the review of procurement cards (Pcards) using an Analytics script. However, the same workflow can also be applied to a variety of other finance, IT, audit, compliance, and risk use cases.

Note

For the purposes of this solution guide, you don't need to understand scripting in detail. If you want to learn more, see Scripting in Analytics.

Where can I create scripts?

You can create scripts in Analytics.

The big picture

An Analytics project stores data analysis information, including tables and scripts.

A script imports, prepares, analyzes, and exports data to Results.

You can then take a script that you run ad hoc in Analytics, convert it to an analytic script (by adding an analytic header), and upload the script to Robots to run tasks on an automated basis.

Steps

Ready for a tour?

Let's take a closer look at these features in context.

Note

If you want to try out the workflow presented in this solution guide, you can download Excel data files (Pcard_Holders and Pcard_Transactions), and copy and paste the example script into Analytics. Alternatively, you can simply review the script to get a general sense of what it does.

1. Create a script

A script may be something as simple as running a command on a single field, or it may be substantial enough to perform the bulk of the work to achieve analysis objectives.

Tip

Typically, the best practice is to segregate tasks into separate scripts. For your convenience, we have presented data import, preparation, analysis, and export in a single script.

2. Add an analytic header to the script

An analytic header is a series of tags enclosed in a comment block at the start of an Analytics script. An analytic header is required for any analytic script that you intend to run in Robots.

Tags are declarative commands inside the analytic header that define inputs, outputs, and instructions for an analytic script. Tags allow the analytic script to run unattended, either immediately, or at a scheduled time.

Tip

An analytic header provides instructions for how to run the analytic script in Robots. Some tags are used by Robots to receive information and others specify what should be produced by the analytic script. For example, you may need to tell Robots which file it needs for an import or which results table to make available to end users.

3. Upload the script to Robots

Once you create an analytic script in Analytics, you can upload it to a robot in the Robots app to test and configure the task automation that you need. The action of uploading scripts from Analytics to Robots is called committing scripts.

Tip

You can use tools in Analytics to validate the analytic header syntax to ensure that it is correct. Perform the validation before committing scripts to Robots so that the analytic script does not fail when it runs.

What's next? 

Learn how to run the analytic script on an automated basis

The Robots app is used to automate repetitive tasks using scripts built in Analytics, and free up time and resources for you and your team to perform work of a more strategic nature.

To find out more, see Scheduling an analysis.

Enroll in an Academy course

Continue to build your knowledge on the concepts introduced in this article by taking the ACL 270 learning path.

Academy is Diligent's online training resource center. Academy courses are included at no extra cost for any user with a Diligent One subscription. For more information, see Academy.