Alteryx Designer Desktop Discussions

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

Filter data for last weekday of the month

wht822
7 - Meteor

Hello,

 

I was wondering if there was a way to filter a data set in Alteryx to only display the last weekday of a certain month.

 

For example, if I have data whose items have corresponding dates of all of August (and nothing but August) and I want it to filter out everything but 8/30/2019 (since 8/31/2019 is a Saturday), would that be possible?

 

Thanks!

6 REPLIES 6
benakesh
12 - Quasar

Hi @wht822 ,

https://help.alteryx.com/10.1/Reference/DateTimeFunctions.htm

datetime format  with  %a or %A  will give Fri  or Friday for all dates . 

Summarize  and filter for maximum Friday date.

Join data to extract records with max Friday date .

 

PhilipMannering
16 - Nebula
16 - Nebula

Hi @wht822 ,

 

Alternative solution for you. See attached.

BrandonB
Alteryx
Alteryx

I think that this should do the trick. The branch of the workflow at the bottom determines the last day of the month of data and then uses another formula to determine if that day is a Saturday or Sunday to go back to the closest weekday. Let me know if this helps. Workflow attached!

 

Filter last weekday.png

wht822
7 - Meteor

Very helpful. Thanks!

wht822
7 - Meteor

Had to tweak this one to fit my specifications but I ended up using this. Thanks! This helped a lot considering I'm relatively new to Alteryx. Any chance you know of a way to run this workflow multiple times, so every spreadsheet in a certain file runs through the workflow with a separate output for each one?

BrandonB
Alteryx
Alteryx

Glad you got it figured out! To run the workflow once for every file you will want to turn it into a batch macro with a control parameter and an action tool (interface category) attached to the file input in order to update the file path and then you will need a creative way of setting the file path to write out to, likely using the "Take File/Table Name from Field" option in the output data tool.

 

A great starting point would be watching this free training video on building your first batch macro: https://community.alteryx.com/t5/Videos/Build-Your-First-Batch-Macro/td-p/52900 

Labels