@Yychel wrote: The main dataset that I share contains promotion information. The months variable refers to the length of the promotion. I want to read merge the main data with sales data. For example, since the length of the promotion for the first record is 2 months, I want to merge that against sales data 1 (sales data in month 1) and sales data 2 (sales data in month 2) with variable obs being the unique id. This would be a simple task if all promotions have the same length. However, the third record has a promotion that lasts 6 months, so I want to read sales data 1, 2, 3, 4, 5, and 6. Is there a way to do it systematically?
@Yychel
There is always a way to do things systematically.
Assuming you're actually after some code example you need to provide some as simple as possible while still representative sample data, explain the logic and show the desired outcome based on the sample data.
Please provide the sample data via SAS data step code that creates it.
... View more