Hi there,
I have two-panel datasets as below and I want to merge the data together. However, since these two have different dates, I want to use the dates in dataset 2 as the panel structure. I want to calculate until time t in the second dataset, what's the total sales.
For instance, until 12-Aug-10, the sales is 2000+1000=3000 etc.
I wonder if anyone knows the command to realize this?
Thanks!
I have two-panel datasets as below and I want to merge the data together. However, since these two have different dates, I want to use the dates in dataset 2 as the panel structure. I want to calculate until time t in the second dataset, what's the total sales.
For instance, until 12-Aug-10, the sales is 2000+1000=3000 etc.
I wonder if anyone knows the command to realize this?
Thanks!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte firm str9 date int sales 1 "9-Aug-10" 2000 1 "10-Aug-10" 1000 1 "13-Sep-10" 12000 1 "12-Nov-10" 300 1 "13-Dec-10" 1000 2 "9-Oct-10" 1000 2 "20-Oct-10" 2000 2 "11-Nov-10" 2000 2 "12-Nov-10" 300 2 "13-Dec-10" 4000 end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte firm str9 date int v1 1 "12-Aug-10" 300 1 "15-Aug-10" 100 1 "15-Nov-10" 200 1 "20-Dec-10" 100 2 "25-Oct-10" 200 2 "10-Nov-10" 100 2 "15-Dec-10" 100 end
Comment