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

Need Help with Macro

Pradeep66
8 - Asteroid

Hi Team, 

 

I have a requirement for macro.

 

I am using this at many places, presently doing this with formula and other tools. For reusability I need to use a macro.

 

input:

 

2022-11-01
2022-11-02
2022-11-03
2022-11-04
2022-11-05
2022-11-06
2022-11-07
2022-11-08
2022-11-09
2022-11-10
2022-11-11
2022-11-12
2022-11-13
2022-11-14
2022-11-15
2022-11-16
2022-11-17
2022-11-18
2022-11-19
2022-11-20
2022-11-21
2022-11-22

 

 

Output1; T1 date is currentday-1 businessday, T5 date is currentdate-6businessday

DateT1 DateT5 Date
01-11-202222-11-202216-11-2022
02-11-202222-11-202216-11-2022
03-11-202222-11-202216-11-2022
04-11-202222-11-202216-11-2022
05-11-202222-11-202216-11-2022
06-11-202222-11-202216-11-2022
07-11-202222-11-202216-11-2022
08-11-202222-11-202216-11-2022
09-11-202222-11-202216-11-2022
10-11-202222-11-202216-11-2022
11-11-202222-11-202216-11-2022
12-11-202222-11-202216-11-2022
13-11-202222-11-202216-11-2022
14-11-202222-11-202216-11-2022
15-11-202222-11-202216-11-2022
16-11-202222-11-202216-11-2022
17-11-202222-11-202216-11-2022
18-11-202222-11-202216-11-2022
19-11-202222-11-202216-11-2022
20-11-202222-11-202216-11-2022
21-11-202222-11-202216-11-2022
22-11-202222-11-202216-11-2022

 

 

Output2:

 

StartDateDayRecordID
22-11-2022Tue1
21-11-2022Mon2
18-11-2022Fri3
17-11-2022Thu4
16-11-2022Wed5

 

 

3 REPLIES 3
n8rushton
Alteryx Alumni (Retired)

Here's a Business Day Calc I wrote, I'm sure you can disect it to get the ref table you want.

Pradeep66
8 - Asteroid

I am able to achieve this. I have illustrated this by appending t1 date and t2 date to filter data. I wrote a macro to identify last 5 business days and filtering out these records.

Pradeep66
8 - Asteroid

thanks for sharing this macro. I am able to write my small piece of macro with your file content and idea help. appreciate it.

Labels