Hi all,
Hoping someone can assist with this. I’ve tried many different ways however could not think of a solution for this.
My dataset contains rows of data
Example:
Product | Day | Number of Sales |
---|---|---|
Apple | 2 | 21 |
Apple | 4 | 34 |
Apple | 5 | 48 |
Apple | 6 | 22 |
Apple | 7 | 31 |
Apple | 9 | 12 |
Is there any way to transform the data and insert rows containing the days where number of sales is blank (in this case day 1, day 3 and day 8) up to the max number of day (in this case day 9)?
Product | Day | Number of Sales |
---|---|---|
Apple | 1 | 0 |
Apple | 2 | 21 |
Apple | 3 | 0 |
Apple | 4 | 34 |
Apple | 5 | 48 |
Apple | 6 | 22 |
Apple | 7 | 31 |
Apple | 8 | 0 |
Apple | 9 | 12 |
Appreciate any input or ideas