I haven’t written very much about Alteryx, although I do now use it EVERY SINGLE DAY. I’ve been hesitant because the Alt Nation Community is fabulous. I struggle with the utility of publishing my own content when it’s not likely to register in search results. However, I frequently write just for myself. And, it pays off. This week I referred back to a Spotfire post I wrote over 2 years ago. Therefore, I’m writing about a problem I ran into this week with scheduling an Alteryx workflow to run on the last business day of the month. If this is a problem you’ve run into, read on.
Alteryx Scheduler
Just in case you aren’t familiar with the Alteryx scheduler, here are 2 screenshots. The first shows the recurring options. Obviously, it doesn’t contain any options here that would help me schedule the workflow to run on the last business day of the month. Granted, this isn’t an easy task. Think of how complex this could get with holidays and time zones.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/scheduler.png)
The second screenshot below shows custom options. Initially, I thought I would use this to create 12 custom schedules (one for each month). I do believe that would have worked, but….
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/custom.png)
The Solution
One of my co-workers, Chris Fink, showed me a much more interesting solution using the Conditional Runner tool from the CrewMacro by Chaos Reigns Within. This tool allows something to happen based on a condition. The condition in my case is a filter.
WARNING: Apparently, there are issues with this macro in the latest version of Alteryx (2019.3). Fortunately, I’m not on that version yet.
If you aren’t familiar with macro installation, you can find that information here.
The Moving Parts
Here is the finished project that I’ll call my Trigger Workflow.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/workflwo.png)
It consists of the following tools:
- Date Time Now tool (In/Out Tool)
- Filter tool
- Conditional Runner tool (CReW macro tool)
- Union tool (optional)
- Filter tool (optional)
- Browse tool (optional)
- Email tool (optional)
Date Time Now Tool
I configured the Date Time Now tool to only show the year, month, and day.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/date-time-config.png)
It produces an output that looks like this.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/Date-time-now-output.png)
That flows to the Filter tool where I have written an expression based on the dates I want the workflow to run. Now, I have scheduled this workflow to run once a day. If it runs and the Date Time Now is NOT equal to one of the dates shown below, nothing happens. If it runs and the Date Time Now does equal one of the dates shown below, it triggers the Conditional Runner tool.
Filter Tool
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/filter-expression.png)
Conditional Runner Tool
The Conditional Runner config looks like the screenshot below. I simply connect it to my workflow, which is saved on a shared drive.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/conditional-runner-config.png)
The Conditional Runner will only navigate to workflows saved on a drive. It will NOT allow you to navigate to a workflow in the Gallery. So far, that is the only limitation I’ve run into with this solution that I didn’t like. It doesn’t matter because I will schedule this Trigger Workflow, not my primary workflow. Thus, my primary workflow can be saved on a drive, and the Trigger Workflow is saved in the Gallery.
The Conditional Runner produces this output from either the Success or Failure branches. I union them together so that I know what’s happening all the time. Then, I apply a filter to get rid of the nulls. Lastly, I email the Conditional Runner output to myself.
![](https://www.bigmountainanalytics.com/wp-content/uploads/2019/09/output-1024x124.png)
Summary Steps
Just to be clear about my steps and all the moving parts, here’s a summary.
- Create primary workflow doing the work.
- Save it to a drive.
- Create Trigger Workflow with the Conditional Runner tool.
- Save it to the Gallery.
- Schedule the secondary or trigger workflow in the Gallery.
Just before wrapping up, I will say that I was surprised I didn’t have to install the macro on the server. It might have already been there installed by someone else, but my workflow ran in the Gallery without any action on my part on the server.
Conclusion
In conclusion, I think I’ll keep writing this stuff up. I love the Alteryx community, but I can see a lot of good reasons to do this here, like longer write-ups and the ability to draft and refine. Hopefully, you make use of this solution for scheduling an Alteryx workflow to run on the last business day of the month.
Alteryx Version
Content created with Alteryx 2019.2.7
If You Enjoyed This
Check out the post I wrote after the 2019 Gartner Analytics Conference. The Alteryx presentation heavily influenced my thoughts.
Pingback: Calculate Working Days Between Two Dates in Spotfire and Alteryx » The Analytics Corner
Pingback: Error Reporting with Alteryx & Spotfire » The Analytics Corner
Pingback: Use Find Replace Tools to Simplify Regex » The Analytics Corner
Pingback: Using the 'In' Operator in Alteryx Filter Tools » The Analytics Corner
Pingback: How to Create A Dynamic Query in Alteryx » The Analytics Corner
Pingback: Manage Analytics Assets with Microsoft Azure DevOps – Part 2 » The Analytics Corner