can some one help me with the code for this problem ?
data trans;
input CustomerID transactiondate$ 10. amount category$;
cards;
9801234 10/01/1998 123.98 toys
9802234 12/10/1997 80.34 books
9802234 12/10/1997 100.00 apparel
9805556 08/01/1996 22.90 toys
9805556 09/10/1996 25.50 apparel
9805556 10/11/1996 18.90 books
9801134 11/11/1999 12.11 toys
;
run;
Total and average amount spent by category
What code have you written?
For numbers 1, 2 and 3, use PROC SUMMARY.
Here are some tutorial video's that will help you answer your question:
@hchan10 wrote:
can some one help me with the code for this problem ?
data trans;
input CustomerID transactiondate$ 10. amount category$;
cards;
9801234 10/01/1998 123.98 toys
9802234 12/10/1997 80.34 books
9802234 12/10/1997 100.00 apparel
9805556 08/01/1996 22.90 toys
9805556 09/10/1996 25.50 apparel
9805556 10/11/1996 18.90 books
9801134 11/11/1999 12.11 toys
;
run;
Total and average amount spent by category
- Which category has the highest average purchase
- What is the average number of categories that customers purchase
- What is the average and total amount by customer
- What is the average number of days between purchases (as of today)
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.