lemonr
07-13-2009, 03:25 AM
Hi, I'm working with this data set that contains transaction dates.
I want the query result to look like this:
transaction_year, transaction_month, count of transactions
iel. 2009 08 15,035
the query I used was:
proc sql;
create table transaction as
select transaction_year, tansaction_month, count(transaction)
from transactiontbl;
group by transaction_year
quit;
The result listed the years and months in the dataset, but for the count of transactions, it gave me the total counts of the transactions in that dataset. For example, if the dataset contains 555,555 transactions, the result would look like:
transaction_year, transaction_month, count of transactions
2009 08 555,555
2009 07 555,555
2009 06 555,555
. . 555,555
. . 555,555
. . 555,555
Could anyone help me how I should fix this problem?
Thanks very very much :)
I want the query result to look like this:
transaction_year, transaction_month, count of transactions
iel. 2009 08 15,035
the query I used was:
proc sql;
create table transaction as
select transaction_year, tansaction_month, count(transaction)
from transactiontbl;
group by transaction_year
quit;
The result listed the years and months in the dataset, but for the count of transactions, it gave me the total counts of the transactions in that dataset. For example, if the dataset contains 555,555 transactions, the result would look like:
transaction_year, transaction_month, count of transactions
2009 08 555,555
2009 07 555,555
2009 06 555,555
. . 555,555
. . 555,555
. . 555,555
Could anyone help me how I should fix this problem?
Thanks very very much :)