karthikeya_ivb
03-12-2009, 07:54 AM
hi all,
i have a query which needs to be done using proc sql. here is the question:
"I have a data containing, 10 transactions in a supermarket, now i want to find the sum of the money spent in last three transactions. i have a variable showing the time of transaction".
in normal SAS we can do this by sorting in descending order and introducing the ID variable and can write a proc summary or proc means.
but how to do the same in proc sql? can we do it in only one query?
thanx in advance,
-Karthik
i have a query which needs to be done using proc sql. here is the question:
"I have a data containing, 10 transactions in a supermarket, now i want to find the sum of the money spent in last three transactions. i have a variable showing the time of transaction".
in normal SAS we can do this by sorting in descending order and introducing the ID variable and can write a proc summary or proc means.
but how to do the same in proc sql? can we do it in only one query?
thanx in advance,
-Karthik