Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Want to create duplicate records for mutiple years

Pramod91
8 - Asteroid

Hello everyone,

 

I have a data sample like this:- 

 

ItemItem descCountryCompanyPSDPEDCurrencyPrice
Fast sprayFast spray 20 mlTBDNew13-11-201308-01-2014Local1,693
Fast sprayFast spray 20 mlTBDNew09-01-201422-05-2014Local1,811

 

It has two prices for an item between 13-11-2013 to 22-05-2014. I want is to show the price change on a graph with years 2011 to 2021 on X axis. For that I created duplicate records with price points for all the years from 2011 to 2021 like this :-

 

ItemItem descCountryCompanyPSDPEDCurrencyPrice
Fast sprayFast spray 20 mlTBDNew01-01-201131-12-2011Local-
Fast sprayFast spray 20 mlTBDNew01-01-201212-11-2013Local-
Fast sprayFast spray 20 mlTBDNew13-11-201308-01-2014Local1,693
Fast sprayFast spray 20 mlTBDNew09-01-201422-05-2014Local1,811
Fast sprayFast spray 20 mlTBDNew23-05-201431-12-2014Local1,811
Fast sprayFast spray 20 mlTBDNew16-10-201431-12-2014Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201531-05-2015Local1,811
Fast sprayFast spray 20 mlTBDNew01-06-201531-12-2015Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201630-12-2016Local1,811
Fast sprayFast spray 20 mlTBDNew31-12-201628-12-2017Local1,811
Fast sprayFast spray 20 mlTBDNew29-12-201731-12-2017Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201831-12-2018Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201931-12-2019Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-202031-12-2020Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-2021-Local1,811

 

Can someone help me find a way to create this type of duplicate records using alteryx?? I will have more Items in the dataset with different prices and dates for which I need to create such duplicate records. Can I do this in alteryx?

3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@Pramod91 
Can you explain your logic for expanding the dates?

I failed to see a pattern in your output data.

Pramod91
8 - Asteroid

@Qiu 

Thanks for your reply. I noticed that I did entered inconsistent dates. Here is the actual data set after expanding and below is the logic behind it:-

 

ItemItem descCountryCompanyPSDPEDCurrencyPrice
Fast sprayFast spray 20 mlTBDNew01-01-201131-12-2011Local-
Fast sprayFast spray 20 mlTBDNew01-01-201212-11-2013Local-
Fast sprayFast spray 20 mlTBDNew13-11-201308-01-2014Local1,693
Fast sprayFast spray 20 mlTBDNew09-01-201422-05-2014Local1,811
Fast sprayFast spray 20 mlTBDNew23-05-201431-12-2014Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201531-12-2015Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201631-12-2016Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201731-12-2017Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201831-12-2018Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-201931-12-2019Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-202031-12-2020Local1,811
Fast sprayFast spray 20 mlTBDNew01-01-2021-Local1,811

 

I simple expanded the dates from 01-01-2011 till 12-11-2013 (a day before the actual price start date), and kept the price as "-" because the prices are not known before the actual price date. Then kept the two actual Price start dates with actual known prices from 13-11-2013 till 22-05-2014 (a price change had happened on 09-01-2014). And after that, duplicated the record with PSD (23-05-2014) of a day after actual PED till end of the year, i.e. 31/12/2014. And then, for each year from 2015 till 2021 assuming that price didn't changed. 

AngelosPachis
16 - Nebula

Hi @Pramod91 ,

 

Following the logic you explained in your previous post, I've created a workflow that I believe answers your question.

 

AngelosPachis_0-1611264818787.png

Please take the time to review it and let me know if it works for you or if you have any questions on the workflow itself.

 

Regards,

 

Angelos

Labels