Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

Capture last years value

ulysses_no
7 - Meteor

Hi,

I have this table:

YEARWEEKVALUE
20221100
20222101
20223102
20224103
20225104
20211105
20212106
20213107
20214108
20215109
20201110
20202111
20203112
20204113
20205114
20191115
20192116
20193117
20194118
20195119

 

I'm struggling with making a flow in Alteryx where I create a new column called "Last Year," and the logic should be that it should capture last year's value.

 

For example:

Last Year Value for the Year 2022, Week 1 --> should capture the Year 2021 Week 1 value.   Like this:

ulysses_no_0-1643634336048.png

 

And it must be ISO safe (handle week 53 logic)

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @ulysses_no 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1643635023380.png

 

Hope this helps : )

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @ulysses_no ,

 

an approach could be a kind of " self-join":

 

2022-01-31_14-15-57.jpg

 

Last Year is Year -1 - then join by  Year and week.

 

Let me know if it works for you.

 

Best,

 

Roland

ulysses_no
7 - Meteor

Thank you, guys! Both solutions worked like I wanted!  Thank you for your time and help!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @ulysses_no 

Cheers and have a nice day!

Labels
Top Solution Authors