Alteryx Designer Desktop Discussions

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

Find a date by the Number of week and year

Ayari
8 - Asteroid

Hello , 

 

I hope you are okey alteryx community ,

I  have a probleme in finding the date of wednesday of a week number and the year ,

 

For exemple i have the week Number : 1 and the year is 2021 and i m looking to find the date of the wednesday of that week and year that means the wednesday of the first week of 2021 .

 

I wish you could understand Me , thnx for Helping me 

 

 

15 REPLIES 15
atcodedog05
22 - Nova
22 - Nova

Hi @Ayari 

 

Jan 1st 2021 was friday so if thats first week is 1st weeks wednesday 30th Dec 2020?

@Ayari 

 

You can use the expression DateTimeFormat(<date/time>, "%U") in the formula tool

 

From the Date Time Functions

atcodedog05
22 - Nova
22 - Nova

Hi @Ayari 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1630576860909.png

 

Hope this helps : )

Ayari
8 - Asteroid

Hello , thnx for your answers i think you didnt understand me good , 

i will give you exemples :

 

week number            YEAR          DATE Result that i m looking for is the date of wednesday of that week

15                             2021            14/04/2021

2                               2021             13/01/2021

14                             2021             07/04/2021

OllieClarke
15 - Aurora
15 - Aurora

Hi @Ayari,

 

According to ISO-8601 Week 1 is defined as the week with the first Thursday of the year, so I've tweaked @atcodedog05's approach to account for that possible mismatch.

 

Hope that helps,

 

Ollie

OllieClarke_0-1630579445966.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Ayari 

 

Please find the enhanced workflow which meets the requirement.

 

Workflow:

atcodedog05_0-1630579684657.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Hi @OllieClarke 

 


@OllieClarke wrote:

 

According to ISO-8601 Week 1 is defined as the week with the first Thursday of the year.

Interesting I didn't know this about ISO week start 🙂

Ayari
8 - Asteroid

thnx for you it worked @atcodedog05 , but what is the difference with what @OllieClarke  did? can you explain to me coz i didnt get the differences? and the flow you did is applied for any years even for dates in 2022 or 2023 or 2020?

Ayari
8 - Asteroid

Actualy i found that it is not correct @atcodedog05  taking an ewemple of week n° 3 and the year 2021 it will gives us 06/01/2021 but its not correct it should be 20/01/2021

Labels