Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculate Business Days in Month, Removing Holidays

dmccandless
8 - Asteroid

Recently I needed to calculate working days per month for a report that includes past complete months (e.g. January 2019) as well as the current, incomplete month (e.g. July 2019, as I write). In the case of the current, incomplete month, I have to grab the 'data_through_this_date' with the fileName for my process.

 

I also need to remove holidays.

 

My employer has six holidays and a policy of Saturday holiday = take prior Friday off, Sunday holiday = take following Monday off

 

Our holidays are:

  • New Year's Day - January 1
  • Memorial Day - Last Monday in May
  • Independence Day - July 4
  • Labor Day - 1st Monday in September
  • Thanksgiving Day - 4th Thursday in November
  • Christmas Day - December 25

So, I built my workflow to follow this logic.

 

All you need to update are:

1. Date field of your data (mine is [Sales Month] in the text input)

2. Business logic for what holidays your employer has, and how they treat weekend holidays

3 REPLIES 3
AlteryxUserFL
11 - Bolide

Thank you for sharing! Super useful!  

dmccandless
8 - Asteroid

Team,

 

I enhanced my workflow. Originally, the workflow was set up only to calculate holidays in the current year.

 

Now the workflow calculates holidays in any year.

dmccandless
8 - Asteroid

I added a bit to the solution. Now, if you feed in data like

 

Month of SalesDate of Sales
20190120190103

 

You'll get back data like:

 

Month of SalesDate of SalesBusiness Days in MonthBusiness Day in Month of Date of Sales
20190120190103222

 

 

Labels