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

Find Business day from date field

AnandKumar1
8 - Asteroid

Hi,

 

I've a date field which has list of all business day for a given month. But the problem is some are in proper format like 1,2,3etc..but some are are like Monday1,Tuesday2. This means 1st monday of month ,2nd tuesday of month.

Is there any way to extract business day from these kinds of format also?

I've attached my workflow to calculate business day.

 

DateBus. Day
2020061
2020062
202006Monday2
2020064
202006Tuesday1
202006Friday3
14 REPLIES 14
Greg_Murray
12 - Quasar

Is this what you are looking for?

Greg_Murray_0-1597240431413.png

 

AnandKumar1
8 - Asteroid

@Greg_Murray 

How we will assign the business day value to  those arbitrary fields?

Monday1 is still coming as Monday1. Instead it shoud come as 1 in this case.

 

ImadZidan
12 - Quasar

Hello @AnandKumar1 ,

 

I am afraid you explanation is not accurate. If Monday 2 is the second monday of the month, this means it is the 8th of jun 2020 which according to your initial explanation should display 8. Am I correct?

 

Otherwise, no need to go through dat processing and extract the number in a string using a formula or Regex.

 

 

Please let us know.

 

AnandKumar1
8 - Asteroid

@ImadZidan 

 

Monday2 is second monday of June month which is actually 6th business day and i've got all the list of business day for month of June2020. But the problem is i already have this businss day column which has value like below

DateBus. Day
2020061
2020062
202006Monday2
2020064
202006Tuesday1
202006Friday3

 

But i want output like this=

DateBus. DayFinal Bus. Day
20200611
20200622
202006Monday26
20200644
202006Tuesday12
202006Friday315
ImadZidan
12 - Quasar

Perfect, My understanding is sort of okay. I see what you mean. Lets give it a whirl.

ImadZidan
12 - Quasar

Hello @AnandKumar1 ,

 

@Greg_Murray  create a great way to generate the data required. I think he was as I was confused on the output.

 

I have used his workflow and added a new part to get the desired output.

 

I hope you find it helpful. 

AnandKumar1
8 - Asteroid

Hi,

 

Thanks for your solution yesterday. It worked well but i'm stuck in one more problem here.

So basically i've 2 column from which i need to calculate business day. I applied your logic both the columns separately and when i tried to Join them, the position of the field got changed. Some data have moved up and because of this my join is not giving correct output.

I just need to find difference b/w these 2 business day . it should give 2 negative values but i'm getting 5 in my workflow and it happened due to change in data position.

Do you know why it happened and how to rectify it?

AnandKumar1
8 - Asteroid

@ImadZidan 

 

Sorry 4 -ve value not 2.

ImadZidan
12 - Quasar

Hello @AnandKumar1 ,

 

Of course, I had a look, I did some cleaning up to get rid of the missing fields. Bit confusing.

I don't see the positive values, However, i see the negative one. You have 8 negative values with the value of 5. As you are expecting 4, I would assume they are being duplicated. Before I do anymore on this, Please have a look at the workflow again and validate my findings.

 

Run the attached flow and lets see.

 

Labels