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

Date calculations

Shank
8 - Asteroid

HI All,

 

I am struggling a bit on calculating the dates for below scenario can some help me on this .

 

I have start date and end date and also the list of holidays. I need to check if my start date and end date falls in between holiday list, then I need to add no of holiday that falls in between start date and end date to end date (i.e., End date + no of holidays)

 

I tried this by applying generate rows formula to start and end date and join with holiday list to count no holidays and add back to end date. but this is tedious when we have huge set of data. is there any other workaround for this?

 

I have attached the Alteryx flow what I tried to achieve.

 

Data: 

 

ProjectStart DateEnd Date
A11/2/202011/20/2020
B11/9/202011/27/2020
C11/9/202011/27/2020
D11/9/202011/27/2020
E11/16/202012/4/2020
F11/16/202012/4/2020
G11/16/202012/4/2020
H11/16/202012/4/2020
I11/16/202012/4/2020
J11/23/202012/11/2020
K11/23/202012/11/2020
L11/23/202012/11/2020

 

 

Holiday List:

 

Date
1/1/2021
2/11/2020
2/12/2020
2/13/2020
2/14/2020
2/15/2020
2/16/2020
2/17/2020
2/18/2020
4/4/2021
5/1/2021
6/14/2021
9/21/2021
10/1/2021
10/2/2021
10/3/2021
10/4/2021
10/5/2021
10/6/2021
10/7/2021
11/5/2020
11/6/2020
11/7/2020
11/8/2020
11/9/2020
7 REPLIES 7
JosephSerpis
17 - Castor
17 - Castor

Hi @Shank I mocked up a workflow let me know what you think?

atcodedog05
22 - Nova
22 - Nova

Hi 

 

Here is a workflow for the task.

Output:

atcodedog05_0-1604304028869.png

 

Workflow:

atcodedog05_1-1604304050498.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

atcodedog05
22 - Nova
22 - Nova

Hi @Shank 

 

Just checked both the workflows your and mine where i am using append tool.

 

Using append tool data will explode more (i,e create more rows )

 

Let me look for a better approach efficient approach.

atcodedog05
22 - Nova
22 - Nova

Hi @Shank 

 

Here is a workflow for the task.

Output:

atcodedog05_0-1604305640304.png

 

Workflow:

atcodedog05_1-1604305656160.png

Previous workflow:

atcodedog05_2-1604305819700.png

I am generating rows for only months and year. So the number of rows generated is reduces by a lot.

 

Previous workflow : Rows generated 288

Proposed workflow : Rows generated 60

 

Rows reduced by a lot.

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @Shank 

 

Cheers and Happy Analyzing 😀

Shank
8 - Asteroid

@atcodedog05 Thanks for the workaround this will really help us to reduce number of columns in the workflow.

Shank
8 - Asteroid

@JosephSerpis This solutions will work but we might tend to end up more number of rows when we use Append tool.

Labels
Top Solution Authors