Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!

SOLVED

Week Number Calculation Starting At Specific Day of Week

jafranco
5 - Atom

Hello all,

 

I'm currently using the following equation to calculate the Week Num based on create dates:

 

tonumber(datetimeformat([shipment_create_dt],"%W"))+1

 

The equation is working correctly, the only issue I'm having is that the equation considers a week Monday to Sunday. I'm trying to find a way for the formula to consider a week Sunday to Saturday, as this is the procedure in which my account reports weekly metrics.

 

As an example, the formula I'm currently using is considering 1/12/20 as week 2 while I would like it to be considered as week 3.

 

I have searched the community and I haven't been able to find an answer, sorry if this has been answered previously.

 

Thank you. 

afv2688
15 - Aurora
15 - Aurora

Hello @jafranco,

 

Is this ok for you?

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

JosephSerpis
15 - Aurora
15 - Aurora

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

jafranco
5 - Atom

Thank you Joseph, this worked perfectly. I appreciate everyone's help.

JosephSerpis
15 - Aurora
15 - Aurora

Hi @jafranco I realized their is a simper way to answer your question. Attached an edited workflow I used the %U syntax with the start date of a week starts on the Sunday and ends on Saturday.

 

Syntax_Date.JPG 

Labels