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
21 - Polaris

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

Raj
16 - Nebula

@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
21 - Polaris
Nandakishore
8 - Asteroid

Hi @binuacs,

 

Thanks for this . 

 

But i need to calculate previous week based on today . 

 

Thanks 

binuacs
21 - Polaris

 

 

'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
21 - Polaris

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

 

image.png

 

Raj
16 - Nebula

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

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels