DATA Step, Macro, Functions and more

Trend of Total Sales

Occasional Contributor
Posts: 12

Trend of Total Sales



My question is "In order to stock the inventory, the store wants to analyze the sales data and predict the trend of total sales for each dress for an extended period of three more alternative days."


For this the supporting data that I have got is as follows :






Not sure exactly which approach to use here or how to go about this problem.





Super User
Posts: 6,932

Re: Trend of Total Sales

The first thing to do is, of course, to transpose your dataset (once it has been imported into SAS; it can't be a SAS dataset at the moment as a date is not a a valid SAS column name) so you end up with three columns: ID, date, sales.

Then you need to calculate the difference from previous to current observation, so you get the daily sales; use the lag() function for this.

Once that is done, you can calculate average sales for certain timespans, or see how sales spread over a week, etc, etc.

Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 17,784

Re: Trend of Total Sales

This is a time series analysis so review the Procs under SAS ETS for a relevant method. 

Regular Contributor
Posts: 194

Re: Trend of Total Sales



Since you have only a few observations at your disposal, you can proceed as follows

1. Transpose your dataset

2. Sum the columns to obtain total sales

3 . use a simple linear regression on a time trend with constant

4. Calculate the predicted values

Regular Contributor
Posts: 194

Re: Trend of Total Sales

I missed the "for each dress" part of your question.
This kind of data is dealt with panel data methods.
Or, if you want to keep it simple, you can run a regression for each dress.
Super User
Posts: 9,671

Re: Trend of Total Sales

Yeah. Post it at Forecast Forum.
There are many PROC you could use like :  PROC ARIMA , PROC ESM .......

Ask a Question
Discussion stats
  • 5 replies
  • 5 in conversation