I'm stuck in the SAS code.I have sorted the data by the date of sale of product over two week time and there are 180 observations and i want to find revenues for the two weeks time , a breakdown of revenues over two weeks time.There are two models of the laptop sold - say A and B and price of A and B are $ 10 and $ 20 respectively.
How do i produce this breakdown for both weeks of sale of the two laptops.
I am providing you the sample code for what you require. I hope thats what you require as an answer.
Keep in mind the "Week" function in the code will give you the week number starting from 1st week of the year i.e. the values will vary from 1 to 52.
Just try understanding the code. If you are new to proc sql, then you can go through the some basic concepts of the same, but the query is as simple as a SQL statement.
input date ddmmyy10. laptop_mod: $2. revenue;
10/03/2009 A 1000
11/03/2009 A 3000
12/03/2009 B 2000
12/03/2009 A 5000
13/03/2009 A 4000
14/03/2009 B 10000
15/03/2009 B 5500
16/03/2009 B 4000
select week(date) as Week, laptop_mod,
sum(revenue) as revenue
group by 1,2