## Trend of Total Sales

Occasional Contributor
Posts: 12

# Trend of Total Sales

Hello,

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 :

 Dress_ID 29/8/2013 31/8/2013 2/9/2013 4/9/2013 6/9/2013 8/9/2013 1006032852 2114 2274 2491 2660 2727 2887 1212192089 151 275 570 750 813 1066 1190380701 6 7 7 7 8 8 966005983 1005 1128 1326 1455 1507 1621 876339541 996 1175 1304 1396 1432 1559

Regards,

Super User
Posts: 10,214

## 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
How to convert datasets to data steps
How to post code
Super User
Posts: 23,683

## Re: Trend of Total Sales

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

Super Contributor
Posts: 340

## Re: Trend of Total Sales

Hi,

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

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

Super Contributor
Posts: 340

## 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: 10,766

## Re: Trend of Total Sales

```Yeah. Post it at Forecast Forum.