This article was previously published under Q304180
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
With a Pareto chart, you can easily analyze categorical data. In a Pareto chart, categories are arranged in descending order from left to right as histogram columns, based upon a selected numeric criterion, from highest to lowest values. Then, an ascending plot line for cumulative percentage is overlaid on the histogram chart. In this way, you can quickly determine which small number of categories makes up a significant percentage of the total value.
This article shows you how to create a basic Pareto chart that uses a PivotChart view that is based on the Sales By Category query in the sample database Northwind.mdb.
Creating a Pareto Chart
To make a Pareto chart in Microsoft Access, follow these steps.
: 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 then open the sample database Northwind.mdb. In the Database window, click Queries under Objects, and then click Sales By Category. On the Edit menu, click Copy. On the Edit menu, click Paste. Save the copy of the Sales By Category query as qrySalesByCategory. Open the qrySalesByCategory query in Design view. Delete the CategoryID field and the ProductName field from the query design 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 then run it. Accept the message to paste rows to a new table. Close the query. In the Database window, click Queries under objects, and then click New to create a new query.
In the New Query dialog box, click 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 query design grid. In the next column on the query design grid, type the following in the Field row:
In the next column on the query design 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 you re-create this example.
CumPct: DSum("[ProductSales]","tblSalesByCategory", _
"[ProductSales]>=" & [ProductSalesTotal] _
Save the query as qrySalesByCategoryPareto, and then close it. Create a Chart Form: In the Database window, click Forms under Objects, and then click New to create a new form. In the New Form dialog box, click AutoForm: PivotChart, click qrySalesByCategoryPareto in the Choose the table or query where the object's data comes from box, and then click OK. Drag Category Name from the Chart field list to the Drop Category Fields Here area. Drag ProductSalesTotal from the Chart field list to the Drop Data Fields Here area. Drag CumPct from the Chart field list to the Drop Data Fields Here area. Close the Chart field list. Modify the Chart Design: Right-click in the white space away from the chart, and then click Properties. On the General tab of the Properties dialog box, set the Select box to Sum of CumPct. On the Type tab of the Properties box, click Line as the type of chart, and then click the first picture in the right pane. Click the General tab, and then set the Select box to Chart Workspace. Click the Series Groups tab. In the Select One or More Series box, click 2 Sum of CumPct, make sure that New Group is selected in the Operation box, and then click OK.
In the Add Axis box, click 2, click Right in the Axis position box, and then click Add. On the General Tab, set the Select box to Value Axis 2. On the Format tab, click Percent in the Number list. Close the Properties dialog box. Right-click inside the first column of data, point to Sort, and then click Sort Descending. Save the form.
You now have a Pareto chart that shows the ordered product sales categories and their corresponding percentages.
Article ID: 304180 - Last Review: September 27, 2003 - Revision: 3.0
APPLIES TO Microsoft Access 2002 Standard Edition