Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
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. 

4 REPLIES 4
afv2688
16 - Nebula
16 - Nebula

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
17 - Castor
17 - Castor

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
17 - Castor
17 - Castor

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