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

Calculating Customized Week number

vshekharrc
7 - Meteor

Hi All,

 

Please see the attached excel file. It has three columns, ReocrdID, Date and calculatedweek. I have a series of dates worth of 1 year for my project. The project start date is 2019-07-01(July1, 2019) through 2020-06-30 (June 30, 2020). I want to create a workflow that populated "calculatedweek" column as shown by the field "calculatedweek"(from 1 to 52). so for example,  dates from 2019-07-01 through 2019-07-06 should have a value of calculatedweek = 1, dates from 2019-07-07 through 2019-07-13 will have a value of calculatedweek = 2 and so on. So every week number will have 7 days. The last few dates after week 52 should be seen as week 52 itself. So please notice that last 9 dates has calculatedweek = 52

Could you please let me know how do I perform this in alteryx. It would be very helpful if you could attach your workflow as well.

 

Regards

Varun Shekhar

6 REPLIES 6
Qiu
20 - Arcturus
20 - Arcturus

@vshekharrc 

Something like this?

And the last two days should belong to week 53 I think.

 

ca1.PNG

Emil_Kos
17 - Castor
17 - Castor

Hi @vshekharrc,

 

I have used the date-time diff formula in order to calculate the week number

 

Emil_Kos_0-1614591929141.png

 

The output:

Emil_Kos_1-1614592013700.png

 

 

grazitti_sapna
17 - Castor

Hi @vshekharrc,

 

Here is my take on this problem using formula tool.

 

grazitti_sapna_0-1614600101787.png

 

If it solves your problem please it as the solution.

 

Sapna Gupta
vshekharrc
7 - Meteor

Hi @Qiu ,

 

Thank you for getting this!. yes, factually it should be 53 as you mentioned, but anything greater than 52 should be regarded as 52 in my work. I will correct that with a simple update.

 

Regards

 

Varun Shekhar

vshekharrc
7 - Meteor

Hi @Emil_Kos 

 

This is a great solution where you have made use of the date column to retrieve the week. Thank you very much! I learnt a couple of new tools and functions in Alteryx!

 

Best,

Varun Shekhar

vshekharrc
7 - Meteor

Hi Sapna,

 

Thank you very much. This solution also addresses my question.

 

Regards

 

Varun Shekhar

Labels