Understanding Limits: 32,500 Unique Items

Một phần của tài liệu Excel PivotTables Recipe Book (Trang 220 - 223)

Problem

Your pivot table is based on a large external database that contains hundreds of thousands of records. You tried to add an OrderID field to the row area of your pivot table, and got the error message “A field in your source data has more unique items than can be used in a PivotTable report. Microsoft Office Excel may not be able to create the report, or may create the report without the data from this field.” You’d like to be able to view the OrderID field in the pivot table.

Solution

If there are more than 32,500 unique items in the field, you won’t be able to add it to the pivot table’s row, column, or page area. It can go into the data area to be summarized.

When using an external database as the source for a pivot table, you can use one or more page fields to limit the data that’s retrieved from the source. These page fields are referred to as server page fields. For example, add the Salesperson field to the page area, and select a salesperson’s name from the dropdown list. Only their orders will be retrieved from the external database, and the number of unique OrderIDs should be below the 32,500 unique item limit.

Note This option is not available for OLAP-based pivot tables.

1. Move one or more fields to the page area of the pivot table.

2. Right-click a page field, and choose Field Settings.

3. Click the Advanced button.

4. Under Page field options, select Query external data source as you select each page field item (requires less memory).

5. Leave the checkmark in Disable pivoting of this field (recommended).

Tip This setting will prevent users from accidentally moving the field to another part of the pivot table, where it could damage the pivot table layout.

6. Click OK to close the PivotTable Field Advanced Options dialog box.

7. Click OK to close the PivotTable Field dialog box.

8. Select an item from the page field dropdown list to see the data for that item in the pivot table.

Note The (All) option is removed from the page field’s dropdown list of items. If (All) was selected in the page field, when Query external data source as you select each page field item is turned on, the first item in the list will be selected after the query runs. If an item is selected in the page field, it will remain selected after the option is turned on.

To regain the ability to show all records, you can turn off the Query external data source as you select each page field item setting:

1. Double-click the page field button.

2. In the PivotTable Field dialog box, click the Advanced button.

3. Under the Page field options, select Retrieve external data for all page field items (faster performance).

9 . 1 ■ U N D E R S TA N D I N G L I M I T S : 3 2 , 5 0 0 U N I Q U E I T E M S W I T H E X T E R N A L D ATA S O U R C E 196

9 . 1 ■ U N D E R S TA N D I N G L I M I T S : 3 2 , 5 0 0 U N I Q U E I T E M S W I T H E X T E R N A L D ATA S O U R C E 197

4. Click OK to close the PivotTable Field Advanced Options dialog box, 5. Click OK to close the PivotTable Field dialog box.

How It Works

Using the Query external data source as you select each page field item option creates server page fields that restrict the amount of data that’s returned from the source database.

When you turn this option on, you can no longer select to see all the data from the field but can select only one item at a time. For example, for a Region field, only one region can be selected, and only its records are summarized in the pivot table.

When you select an item from a server page field, Microsoft Query opens and returns the data for the selected page field item. You’ll see the Microsoft Query button on the Windows Taskbar, and may see the query progress indicator at the left side of the Excel Status bar. The pivot cache is cleared and then filled with records for the newly selected item. The pivot table is refreshed and shows the current records.

When using this option, it’s best to leave on the setting for Disable pivoting of this field, as recommended in the PivotTable Field Advanced Options dialog box. If the page field were moved to another part of the pivot table, the Query external data source setting would be automatically turned off. All the data would be retrieved, and fields with too many unique items would be removed from the pivot table layout.

Using this option may make the pivot table slower when you select a different item in the page field dropdown list. Because it has to retrieve the data from the external source, then display it, it takes longer than changing the item in a normal page field dropdown, where all the data is already available.

An advantage to using the option is that less memory is used, because all the data isn’t in the pivot cache. This can make the file size much smaller, even if the data is saved with the pivot table. Also, by returning the data in smaller segments, you can prevent some fields from exceeding the unique item limit, which they might otherwise hit if all the data were returned.

Tip If you apply this setting to a page field in the PivotTable and PivotChart Wizard, as you create the pivot table, the initial setup time for the pivot table may be faster.

Một phần của tài liệu Excel PivotTables Recipe Book (Trang 220 - 223)

Tải bản đầy đủ (PDF)

(336 trang)