Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Iterative macro for picking closest previous working day

michalk36
7 - Meteor

Hi all,

 

I'm working on iterative macro which will pick previous working day based on excluded range. 

I have prepared list of weekend/holidays and joined it against full calendar which results in days excluded (weekends/holidays) from from further calculations and those which should be considered (working days).

The macro needs to take input date (which is the weekend/holiday) and pick previous working day.

For example input is 2021-08-30 macro needs to output 2021-08-27

 

michalk36_0-1632292915815.png

 

I came up with macro which lookups picked date and subtracts iteration number from created record id which should in the end result in picking date which matches the filter [day] = 'in'

 

michalk36_1-1632294035640.png

 

for some reason I'm not able to make it work...

Can somebody point me the right direction where I'm making mistake??

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@michalk36 
Can you calcute the DateDiff between your input and the excluded dates, the one has miminum different should be the closest working day.
If you can share your workflow, I can take a look and see if I can help.

michalk36
7 - Meteor

Hi @Qiu 

thanks for quick answer, I need specifically pick the date so diff wouldn't do much here. 

Please check the attached macro

Qiu
21 - Polaris
21 - Polaris

@michalk36 
here is my try.

and I dont quite get it since you mentioned you use iteration.

It is more like a batch macro to me.

Capture6A.PNG

michalk36
7 - Meteor

@Qiu thanks a lot! I'll take a look and give a shout but it looks very promising!!

Labels
Top Solution Authors