Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Creating a Pivot Table or Pivot Chart from a Table


Pivot tables and pivot charts provide great ways for you to summarize detailed data stored in your Jet and SQL Server databases. Pivot tables present your data in a spreadsheet-like format, whereas pivot charts automatically render pivot table views as line, bar, or area charts. Access 2002 and Access 2003 provide two new views for tables: PivotTable and PivotChart. These views are available for both your conventional Jet applications (MDB) and your Access Projects (ADP).

Creating the Table to Display in PivotTable or PivotChart View


The first thing you must do is build a table that is appropriate to display in PivotTable or PivotChart view. Tables that lend themselves to be displayed in PivotTable or PivotChart view provide many ways for users to manipulate their data. An example of such a table is one that contains information about country, city, salesperson, sales, and date of sale. You could determine sales by city and salesperson for each month, or you could determine sales in each country for each salesperson during the year of 2002. As you can see, the idea of pivot tables is to let you slice and dice the data any way you need to at a given moment in time. A table ideal for you to display as a pivot table generally would

not be very normalized.

For our example, create the following table within the Northwind database:


  • Create a new table in Design view.

  • Add the following fields :
    Country, Region, City, SalesPerson, OrderDate, ProductName, Price, and Quantity.

  • Add at least 10 rows of data to the table.


  • Displaying the Query in PivotTable View


    To switch to PivotTable view, select the PivotTable View button on the toolbar. The empty PivotTable view appears and the Access toolbar changes to the PivotTable toolbar (see Figure 2.40).

    Figure 2.40. When you switch to PivotTable view, the empty PivotTable view appears and the Access toolbar changes to the PivotTable toolbar.


    The PivotTable Field List window also appears. There are four types of fields that you will add to your pivot table. They include the following:

    • Column

      fields
      Often hold date fields; generally hold information with the fewest number of data items.

    • Row

      fields
      One or more fields that display data by attributes.

    • Total

      or Detail

      fields
      The crosstab data itself. These are the numeric values that make up the meat of the pivot table.

    • Filter

      fields
      One or more

      optional fields that restrict that data appearing in the columns, rows, or both.


    To display our initial pivot table, take the following steps:


  • Drag the Country field so that it appears as a Row field.

  • Drag the City field so that it appears as a second Row field to the right of the Country field.

  • Drag and drop the Order Date By Month field so that it appears as a Column field.

  • Drag and drop the Total so that it appears as a Detail field. The resulting pivot table appears in Figure 2.41.

    Figure 2.41. The pivot table that appears after dragging and dropping the Total so that it appears as a Detail field.


  • Displaying Summarized Data


    Including all of the detail data could be much more detail than you need. You can alter the query design to show only summary information. Here's how it works.


  • Click any of the Totals buttons.

  • Click the AutoCalc tool and select Sum.

  • Click to select the Hide Details tool on the toolbar. The resulting pivot table appears in Figure 2.42.

    Figure 2.42. The pivot table with summarized data.


  • Filtering Pivot Table Data


    By default, Access includes all data in the pivot table. You can filter the pivot table to display only selected values for a row or column. For example, you can filter to display data for only sales in specific countries. Here's how it works:


  • Make sure that you have expanded the PivotTable display to include the detail for the data on which you want to filter (see the following section on using drill-down).

  • Click the arrow of the field button to filter. The list contains an item for each field value (see Figure 2.43).

    Figure 2.43. The list contains an item for each field value.

  • Click the (All) check box to deselect all fields.

  • Click to select the field values that you want to include in the output.

  • Click OK to close the list and apply the filter.


  • Using Drill-Down


    Generally the initial pivot table contains an excessive amount of detail. Here's how you can modify the amount of detail to show summary information only:


  • Switch to Design view.

  • Click the Totals button to eliminate the data grouping.

  • Return to PivotTable view. The Total or Details Fields drop zone is empty because you changed the structure of the query.

  • Click the Field List button to display the PivotTable Field List.

  • Expand the Totals item.

  • Right-click the Sum of Total item and select Delete, which clears the data from the cells.

  • Drag the Years button outside the window to remove the columns for the years, leaving an empty No Totals column.

  • Click Show Details, and then drag the No Totals column outside the window. At this point, the Column Fields and Totals or Detail Fields drop zones are empty.

  • Drag the Total column to the Columns drop zone.

  • Click the Show Details button and then the Hide Details button. You will see the data expand and collapse.


  • Exchanging Axes


    If you are viewing the year across the top and the country down the side, and you decide to view year across the side and country across the top, simply drag and drop their name buttons to switch the positions in which they appear. You can also easily drag new items to the pivot table from the PivotTable list at any time, or remove them from the pivot table entirely.

    Switching to PivotChart View


    When you define a PivotTable view, you automatically generate a PivotChart view. You will see how evident this is by using the View tool to switch to PivotChart view. The results appear in Figure 2.44. You can use toolbar buttons to add legends and to modify the chart type.

    Figure 2.44. PivotChart view shows the PivotTable as a chart.



    / 544