Hi,
I need to add the date incrementally from a certain starting date. My data look like this
data try;
input Product factory Week quantity ;
datalines;A 1 1 3
A 1 1 4
A 1 1 5
A 1 1 6
A 1 1 3
A 1 1 5
A 1 1 5
A 1 2 6
A 1 2 5
A 1 2 5
A 1 2 4
A 1 2 5
A 1 2 4
A 1 2 5
B 1 1 3
B 1 1 2
B 1 1 3
B 1 1 2
B 1 1 3
B 1 1 2
B 1 1 3
B 1 2 5
B 1 2 4
B 1 2 5
B 1 2 5
B 1 2 4
B 1 2 5
B 1 2 5
;
run;
The week column tells the the number of the week. Each week is repeated for 7 rows to give information for 7 days. I want to the add the date incrementally from a certain starting date. So the days change based on the week sequence and the circle need to be done for each product .
The table I want should look like this
product factory Week Quantity Date
A 1 1 3 20200120
A 1 1 5 20200121
A 1 1 6 20200122
.
,
,
B 1 1 3 20200120
B 1 1 2 20200121
B 1 1 3 20200121