|
在这里. http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q208373
ACC2000: How to Create a Pareto Chart Using Microsoft Graph
The information in this article applies to:
Microsoft Access 2000
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
Summary
A Pareto chart provides a simple way of analyzing categorical data. In a Pareto chart, categories are arranged in descending order from left to right as histogram columns, based upon a selected numerical 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 make up a significant percentage of the total value.
This article shows how to create a basic Pareto chart, using the Sales By Category query in the sample database Northwind.mdb.
More Information
Creating a Pareto Chart
To make a Pareto chart in Microsoft Access 2000, follow these sets of steps.
CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform 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 |
|