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

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

dates to be represented as week dates.

Ronal_bal
8 - Asteroid

Hi,

I've dates like

2022-06-06,
2022-06-13,
2022-06-20,
2022-06-27 and similarly for all the months.

I need to show that as

2022-06-06 1st week
2022-06-13 2nd week
2022-06-20 3rd week
2022-06-27 4th week

7 REPLIES 7
DataNath
17 - Castor
17 - Castor

Hey @Ronal_bal are you really precious about that format? Or would something like the output below work? I'm not aware of any easy way to add the cardinals without a massive bruteforce if statement, though I may just be missing something! I just added the sort tool in case there's a chance some dates aren't in order - if it's not needed then obviously just delete it.

 

DataNath_0-1655401679225.png

 

DataNath
17 - Castor
17 - Castor

Ok never mind, it wasn't actually too bad! Updated workbook attached.

 

DataNath_0-1655402465796.png

 

Ronal_bal
8 - Asteroid

I need similar to this

Formula : 'Week '+ datetimeformat([Date],'%A')

for the input 2022-06-16 output is week 24 for the above formula.

which will give the week number. But also the date the week starts with (i.e. Monday)

something like this for the input 2022-06-16. expected output can be 2022-06-16 week-2. and

from the next month it can be like 2022-07-04 , expected output 2022-07-04 week-1

grazitti_sapna
17 - Castor

Hi @Ronal_bal, there is no direct way of achieving this but using formulas to get the desired result.

grazitti_sapna_0-1655404414987.png

 

Please refer to this workflow and let us know if it helps!

 

Thanks!

Sapna Gupta
DataNath
17 - Castor
17 - Castor

So you want to see what week of the month it is? Does this work?

 

DataNath_0-1655404475814.png

 

If not, can you give a bit of a clearer description on the logic?

Ronal_bal
8 - Asteroid

Formula : 'Week '+ datetimeformat([Date],'%W')

The above formula provides me the week number in a year (0-52). for example 2022-06-17, the output is week 24.

With week 24 as output , I need that date on which I calculates the week number.

In this case, its calculation on Monday of every week as starting date of week

2022-06-17 - input

2022-06-13 week 24 - expected output, because June 13 is the beginning of this week. which I needed in the output along with week number.

DataNath
17 - Castor
17 - Castor

How does this look? I've included a whole week in my example so you can see it working for any day of the week.

 

DataNath_0-1655468408647.png

 

Labels
Top Solution Authors