Creating a Pareto Chart
To make a Pareto chart in Microsoft Access 2000, follow these sets of steps.
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
Create the Data Source for the Chart
- Start Microsoft Access and open the sample database Northwind.mdb.
- In the Database window, click Queries, and then select Sales By Category. On the Edit menu, click Copy, and then click Paste. Save the copy of the Sales By Category table as qrySalesByCategory.
- Open the qrySalesByCategory query in Design view. Delete the
CategoryID field and the ProductName field from the QBE grid. Set the Sort order of the ProductSales field to Descending.
- On the Query menu, click Make Table to change the query to a Make Table query. In the Make Table dialog
box, type tblSalesByCategory in the Table Name box.
- Save the query and run it. Accept the message to paste rows to a new
table.
- Close the query.
- In the Database window, click Queries, and then click New to create a new query. In the New Query dialog box, select Design View, and then click OK. In the Show Table dialog box, click tblSalesByCategory, click Add, and then click Close.
- Drag the CategoryName field to the QBE grid.
- In the next column on the QBE grid, type the following in the Field row:
ProductSalesTotal: [ProductSales]
- In the next column on the QBE grid, type the following in the Field row:NOTE: In the following example, an underscore (_) at the end of a
line is used as a line-continuation character. Remove the underscore
from the end of the line when re-creating this example.
CumPct: DSum("[ProductSales]","tblSalesByCategory", _
"[ProductSales]>=" & [ProductSalesTotal] _
& "")/DSum("[ProductSales]","tblSalesByCategory")
- Save the query as qrySalesByCategoryPareto, and then close it.
Create a Chart Form
-
In the Database window, click Forms, and then click New to create a new form. In the New Form dialog box, click Chart Wizard, select qrySalesByCategoryPareto as the query where the object's data comes from, and then click OK.
- Move all three available fields to the Fields for Chart box. Click Next.
- Select Line Chart as the type of chart to use. Click Next.
- Double-click SumofProductSalesTotal, and then click None under Summarize.
- Click the CumPct field, and drag it underneath the ProductSalesTotal field. (Do not replace ProductSalesTotal, but add CumPct to the Data section.)
- Double-click the SumofCumPct field, and then select None under Summarize. Click Next.
- For the chart title, type Sales by Category - Pareto, and then click Finish.
Modify the Chart Design
- On the View menu, click Design View.
- On the View menu, click Properties to display the form property sheet, if it is not already visible.
- On the Form property sheet, set the Width to 8".
- Click the Detail section, and then set the Height to 6".
- Click the Unbound Object Frame that contains the chart, and then set Height to 6" and Width to 8".
- Right-click the chart, point to Chart Object, and then click Edit.
- Right-click the vertical axis, and then select Format Axis. Click the Number tab. Select the Currency category. Click the Font tab, click to clear the Auto scale box, and then click OK.
- Right-click the horizontal axis, and then select Format Axis. (You may need to click slightly below the axis to avoid selecting the data
series).
- Click the Alignment tab, and then set the label alignment to automatic. Click the Font tab, click to clear the Auto scale check box, and then click OK.
- Right-click the ProductSalesTotal data series. Select Chart Type, click Column, and then click OK.
- Right-click the CumPct data series. Select Format Data Series.
- Click the Axis tab. Under Plot series on, click Secondary Axis, and then click OK.
- Right-click the new vertical axis that now appears on the right side of the chart. Select Format Axis. Click the Number tab. Select the Percentage category. Click the Font tab, click to clear the Auto scale check box, and then click OK.
- Resize the chart with the mouse pointer to fill the form. Resize and move the legend to an appropriate place on the chart, if necessary.
- Save the form. On the View menu, click Form View.
You should now have a Pareto chart showing the ordered product sales
categories and their corresponding percentages.