Alteryx Designer Desktop Discussions

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

Looking up prior year values

jayviz
7 - Meteor

Scenario

I have the below data where corresponding to each Company, SKU, Year, Week, Product Type we have  Qty.. We are trying to get prior year corresponding week Qty in a separate column.. Same SKU can be available across multiple types so we need to take the unique combination and look up what' s the corresponding value in prior year.

 

Example

e.g. corresponding to 1st row the value expected will be 610 (that is the value for officemax,SK1,2019,week 1).. similarly corresponding to Lowes,SK1,2020,Week3 will be 680.. and so on. If the corresponding value does not exist in a prior year it can be 0 or null.. 

 

Dataset

 

CompanySKUWeekYearQtyProduct Type
OfficemaxSK112020500Home Supplies
OfficemaxSK212020400Home Supplies
OfficemaxSK122020350Home Supplies
OfficemaxSK112020980Electronics
OfficemaxSK212020170Electronics
OfficemaxSK112019610Home Supplies
OfficemaxSK212019120Home Supplies
OfficemaxSK222019350Home Supplies
OfficemaxSK112019900Electronics
OfficemaxSK2120191400Electronics
OfficemaxSK2120181200Home Supplies
OfficemaxSK312018556Home Supplies
OfficemaxSK112018340Electronics
LowesSK1120207500Home Supplies
LowesSK1320206500Home Supplies
LowesSK112019680Home Supplies
LowesSK132019520Home Supplies
5 REPLIES 5
Qiu
20 - Arcturus
20 - Arcturus

@jayviz 

Is something like this?

Appreciate if you would make it as accepted if you find it useful.

1030-jayviz.PNG

jayviz
7 - Meteor

@Qiu  Looking this as an additional column (Prior Year Qty) like below..

 

jayviz_0-1603930510168.png

 

Qiu
20 - Arcturus
20 - Arcturus

@jayviz 

I think this is the one.1030-jayviz-1.PNG

jayviz
7 - Meteor

@Qiu  this is great, Thank you !

Qiu
20 - Arcturus
20 - Arcturus

@jayviz 
Thank you also for the mark. Have a good day!

Labels