I would like to make a pivot table, meaning show sums of one variable, where rows show values of another variable and columns show values of another variable.
Example Input:
time X1 X2
Jan2015 30 Group1
Jan2015 20 Group1
Jan2015 200 Group2
Feb2015 15 Group1
Feb2015 150 Group2
Feb2015 120 Group2
Desired Output (sum of X1, rows are time, columns are X2):
Group1 Group2
Jan2015 50 200
Feb2015 15 270
I also need the output to be another dataset, the result will be too large to copy from the output window.
I have tried reading many other posts but could not find an answer. Thanks in advance.
Example Input:
time X1 X2
Jan2015 30 Group1
Jan2015 20 Group1
Jan2015 200 Group2
Feb2015 15 Group1
Feb2015 150 Group2
Feb2015 120 Group2
Desired Output (sum of X1, rows are time, columns are X2):
Group1 Group2
Jan2015 50 200
Feb2015 15 270
I also need the output to be another dataset, the result will be too large to copy from the output window.
I have tried reading many other posts but could not find an answer. Thanks in advance.
Comment