Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72764

Merge and sum simultaneously

$
0
0
Hello,

I have two data sets that I would like to merge, but I would like a summation (from Dataset 2 below) to occur before the actual merger, and that value be added on (to Dataset 1). I have attached a fuller excel file that contains two example accounts, and the values that I'd like to be summed and merged.

Dataset 1 are monthly bills for a given account that have a start and end date (original data set has about 3000 accounts for 10 years)- each account is generally billed on different date intervals. Dataset 2 is a daily ET factor. The shared variable between the two data sets is microzone (of which there are about 50), and the date obviously plays a factor. For a given account and bill, I'd like to have the ET factor summed for those specific dates (or what falls between them), and merged to that account. Below is an example of what the data looks like- please let me know what you think is best, and thank you in advance.

Dataset 1
account usage perunitrate startdate enddate microzone
30 22 1.12 10-Dec-04 11-Jan-05 10860762
30 14 1.12 11-Jan-05 10-Feb-05 10860762
30 15 1.12 10-Feb-05 14-Mar-05 10860762
Dataset 2
et_factor microzone effectivedate
0.25 10860762 8-Jan-05
0.21 10860762 9-Jan-05
0.19 10860762 10-Jan-05
0.14 10860762 11-Jan-05
0.08 10860762 12-Jan-05
0.07 10860762 13-Jan-05
0.08 10860762 14-Jan-05
0.09 10860762 15-Jan-05
0.1 10860762 16-Jan-05
0.09 10860762 17-Jan-05
0.1 10860762 18-Jan-05
0.1 10860762 19-Jan-05
0.11 10860762 20-Jan-05
0.09 10860762 21-Jan-05
0.1 10860762 22-Jan-05
0.09 10860762 23-Jan-05
0.09 10860762 24-Jan-05
0.09 10860762 25-Jan-05
0.08 10860762 26-Jan-05
0.06 10860762 27-Jan-05
0.07 10860762 28-Jan-05
0.07 10860762 29-Jan-05
0.08 10860762 30-Jan-05
0.08 10860762 31-Jan-05
0.05 10860762 1-Feb-05
0.09 10860762 2-Feb-05
0.1 10860762 3-Feb-05
0.2 10860762 4-Feb-05
0.15 10860762 5-Feb-05
0.18 10860762 6-Feb-05
0.26 10860762 7-Feb-05
0.24 10860762 8-Feb-05
0.22 10860762 9-Feb-05
0.17 10860762 10-Feb-05
0.13 10860762 11-Feb-05
0.08 10860762 12-Feb-05
0.07 10860762 13-Feb-05
0.08 10860762 14-Feb-05

Viewing all articles
Browse latest Browse all 72764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>