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

Appending current column data to another column in sequential order

kv-defy
8 - Asteroid

I have data that is like this:

 

DateDay (1st week)Actual
2022-06-06Mon 5
2022-06-06Mon2
2022-06-06Mon1
2022-06-06Mon6
2022-06-06Mon7
2022-06-07Tues9
2022-06-07Tues11
2022-06-07Tues8
2022-06-07Tues0
2022-06-13Mon4
2022-06-13Mon10
2022-06-13Mon32
2022-06-13Mon2
2022-06-13Mon5
2022-06-14Tues18
2022-06-14Tues2
2022-06-14Tues3
2022-06-14Tues5
2022-06-14Tues0

 

I want to include a table which has an additional column called Previous while having values from the previous week same day with values. I have dataset technically that spans from Mon to Sun where the weekends data are generally empty. How do I do so in a sequential order? Thank you!

 

E.g. Mon (Week 1) Actual will be in Forecast of Week 2 etc for the rest of the week

 

Desired:

DateDay ActualPrevious
2022-06-06Mon5(Prev Mon's data)
2022-06-06Mon2 (Prev Mon's data)
2022-06-06Mon1 (Prev Mon's data)
2022-06-06Mon6 (Prev Mon's data)
2022-06-06Mon7 (Prev Mon's data)
2022-06-07Tues9 (Prev Tues's data)
2022-06-07Tues11 (Prev Tues's data)
2022-06-07Tues8 (Prev Tues's data)
2022-06-07Tues0 (Prev Tues's data)
2022-06-07Tues2 (Prev Tues's data)
2022-06-13Mon (next week)45
2022-06-13Mon102
2022-06-13Mon321
2022-06-13Mon26
2022-06-13Mon57
2022-06-14Tues189
2022-06-14Tues211
2022-06-14Tues38
2022-06-14Tues50
2022-06-14Tues02

 

Edited - Added the dates column

4 REPLIES 4
gabrielvilella
14 - Magnetar

Hi @kv-defy, maybe this is what you are looking for.

gabrielvilella_0-1657599374232.png

 

kv-defy
8 - Asteroid

Hi @gabrielvilella , thank you for your solution! Really appreciate it. However, for the initial dataset, both the weeks are in the same table and there are many weeks I have to deal with it. How do I proceed from there?

 

Edit: I have changed the original dataset.

grazitti_sapna
17 - Castor

Hi @kv-defy, give this a try.

grazitti_sapna_0-1657600830704.png

 

I hope this helps!

Thanks!

Sapna Gupta
binuacs
21 - Polaris

@kv-defy One way of doing this

binuacs_0-1657610904492.png

 

Labels
Top Solution Authors