Naming Data Fields

We should make a few remarks about naming data fields. It is important to note that if the name of a data field has not been changed but we make a change to the aggregate function, say from Sum to Average, then Excel will automatically rename the data field, in this case from Sum of Sales to Average of Sales. However, once we set a new name for the data field, Excel will not rename it when we change the aggregate function.

We can rename a data field simply by setting its Name property. However, even though Data fields do not seem to belong to the PivotFields collection, we cannot use the name of a pivot field for a data field. For instance, we cannot rename Sum of Transactions to Transactions, since this is already taken by the pivot field. (Trying to do so will produce an error.) Thus, in designing the source table for the pivot table, we should choose a column heading that we do not want to use in the pivot table!

0 0

Post a comment