04-23-2015 11:01 AM
I have a dataset in the format below. I am interested in having a Days to Departure range of 0-365 for all products/subproducts for a journey date.
04-24-2015 12:52 AM
Hi the output should have days to departure (0-365) essentially 365 rows for each product code and sub code ... For product code 100 and sub code 1, the days to departure will be 0 to 365 (365 rows) and value of sold will be recorded against rows 20 and 300...
I always look for last 365 rows, so no problems with leap years for now.
My approach has been to create a lookup dataset for days to departure (with one column containing 365 rows each representing one day to departure). I then multiply that table with my original dataset to achieve what I said above. However, I was wondering if there is an alternative way (quicker) to do the same?
The newly created dataset will have a missing value for days there was no sale and that's fine
04-24-2015 05:57 AM
I would like the final dataset to have 365 rows for each product code and sub code. So for product 100 and subcode 1, the resulting dataset will have only values for days 20 and 300, all others rows will have a missing value.
I am only interested in 0-365 days, so not worried about leap years.
My approach has been to create a dataset with 365 rows and a CROSS JOIN to the above table to get the desired output, but I was wondering if there are alternative solutions?