Although Q is not specifically designed for sales data, such data can be analyzed in Q. This can be useful when the user is using Q for most of their analysis, or, is wanting to overlay the sales data with other data (see Multiple Data Files).
Setting up the data
Commonly, sales data is stored in one or more tables, such as in the example below. Such data usually needs to be restructured prior to being used in Q.
Usually, it is useful to stack the data prior to importing it into Q. With sales data, this usually means restructuring the data so that all the sales data appear in a single column. Make sure when doing this that any dates are stored as dates in Excel (e.g., rather than have a cell containing February '15 it should contain 2/1/2015 if you are in the US and 1/2/2015 for most of the rest of the world).
If you have stacked the data in the way described above, the process for analyzing it in Q is as follows:
- In the Variables and Questions tab, make the variable available as a weight (see Making Variables Available as Weights).
- Check that the date variable has shown as having a Variable Type of Date. If it does not, find the original Text variable that was imported, manually change its Variable Type to Date, and delete any Categorical date variables created by Q (if there are any).
- Press and modify the Date question's Value Attributes (see How to Set Time Periods for Date Questions).
- In the Outputs Tab, select the weight variable in the Weight drop-down menu, at the bottom of the screen.
- Edit > Project Options > Customize > Output Text and in the Override Text column type Sales next to Population (you may wish to change any other statistic containing "Population" in the same way) and press OK.
- Right-click on the table and select Statistics - Cells > Sales.
- Use Filters or Banners to create more complicated tables.
For example, the table below shows the data from the table above, but created using Q.