Fort Myers-Naples, FL

VeraData and Alteryx Tip Part 2-Batch Macro

VeraData101
7 - Meteor

VeraData Example of a Batch Macro Part 2.

 

In the previous post, we discussed using a Batch Macro. Let’s take a short review.

 

Client request: Single out a random number of names from each state in the database.

We didn’t receive any additional criteria to base our selection on, so we needed to take a pre-determined quantity for each state from our processed file.

Resolving idea: Created an excel file (it can be in any format you prefer).  We pulled all states and proper quantities for each, to create a batch macro; this processed the data automatically.

Advantages of this approach: the main goal was to reduce our time-spent (time needed for implementing this task manually was like 2 hours) and created the template for similar tasks in the future.

Status of implementation: We built separate workflows - the main workflow contained input files, the macro tool, and additional tools which we used for reviewing. The macro workflow contained Macro Input and Output tools, Filter, Sample, and Control Parameter tools for each item of selection (state and quantity) and Action tools.

 

As we mentioned before, I’ll describe the Action tool in more detail.

 

Post 8 1.jpgPost 8 2.jpg

 

We adjusted the Action tools for replacing determined parameters.

 

Once the macro workflow is completed, go to the main workflow and custom macros tool:

 

Batch Macro Configuration and Questions:

-In the drop down line “Qty field”, choose Qty

-In the drop down line “Choose State Field”, choose State. (use Group By option if you need to get input data in specific order)

 

Post 8 3.jpg

 

After that, run your workflow and compare the results of the macros processing with your input file.

If you ran it correctly, your results should look like screenshots below:

 

Post 8 4.jpgPost 8 5.jpg

 

As you can see, the data was processed properly; the output file contains States and Quantity according to the instructions.

 

Tips for Using Macros.

 

If you’ve created those Batch Macro’s for a recycling task (as it was in our case), you may want to save it and use it in the future. This will allow you to include those macros into your Alteryx environment or share it with your co-workers.

 

We’ll recommend that you create a folder with all of your macros in it. Choose a folder destination and make sure that everybody in your office has access to it (or give permission to a smaller group of team members).

 

Once that’s done, head into Alteryx and complete next steps:

 

In the top right menu, select Options - User Settings - Edit User Setting - Macros and then click the plus icon.

After that, insert the Category Name (“Macros”) - Search Path (way to the shared folder which contains macros) - Click apply - Click Ok.

 

You’ll then see your Macros tab in your Alteryx Tool Palette.

 

Note: each new folder you create will become a new tab in your Tool Palette. If you want to use the same tab for all of your macros, insert them into the same folder.

 

Hope this helps!  

Looking forward to your feedback on any of these posts!

0 REPLIES 0