Alteryx Designer Desktop Discussions

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

WeekandYear

Nandakishore
8 - Asteroid

Hi,

 

Need to calculate previous week along with year (232024) . This should be applicable across years.

 

Thanks

9 REPLIES 9
binuacs
20 - Arcturus

@Nandakishore can you elaborate more on your requirement with some input data and expected output for a better understanding?

Raj
15 - Aurora

@Nandakishore 
please ad some sample input and expected output 
will be in better position to help.

Nandakishore
8 - Asteroid

Hi @binuacs@Raj ,

 

This week is Week 24 and year 2024. I need a formula to calculate like W232024  .

 

When we move into next year 2025 in the first week it need to calculate W522024 and there on . 

 

Thanks 

binuacs
20 - Arcturus
Nandakishore
8 - Asteroid

Hi @binuacs,

 

Thanks for this . 

 

But i need to calculate previous week based on today . 

 

Thanks 

binuacs
20 - Arcturus

 

 

'W'+DateTimeFormat(DateTimeAdd(DateTimeToday(),-7,'day'),'%W')+toString(DateTimeYear(DateTimeToday()))

 

 

Nandakishore
8 - Asteroid

Hi @binuacs,

 

Thanks again .

 

Now when i run the solution on 1st week of Jan '25 then it must give W522024 . How to do this .

 

Thanks  

binuacs
20 - Arcturus

@Nandakishore of that you need to give the date manually to the formula and replace the DateTimeToday() with that field

 

image.png

 

Raj
15 - Aurora

@Nandakishore 
just a small change if it is week 52 then year should be ([year]-1)

Labels