XML - pivotCacheDefinition part

The pivotCacheDefinition part defines each field in the source data, including the name, the string resources of the instance data (for shared items), and information about the type of data appearing in the field. Note: some of the "Customer Name" and "City" values have been removed to improve readability and reduce length.

<pivotCacheDefinition xmlns:r="…" r:id="rId1" refreshedBy="AnonUser"
  refreshedDate="2006-05-22T10:07:16" createdVersion="3"
  refreshedVersion="3" minRefreshableVersion="3" recordCount="182">
  <cacheSource type="worksheet">
    <worksheetSource name="Table1"/>
  </cacheSource>
  <cacheFields count="28">
    <cacheField name="Customer Name" numFmtId="0">
      <sharedItems count="7">
        <s v="Michele  Raman"/>
        <s v="Misty  Raji"/>
        <s v="Tabitha E Arthur"/>
        <s v="Clarence D Rai"/>
        <s v="Jimmy L Moreno"/>
        <s v="Rob  Verhoff"/>
        <s v="Levi  Sai"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Group" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Country" numFmtId="0">
      <sharedItems count="1">
        <s v=""/>
      </sharedItems>
    </cacheField>
    <cacheField name="Region" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="State" numFmtId="0">
      <sharedItems count="5">
        <s v=""/>
        <s v="Queensland"/>
        <s v="South Australia"/>
        <s v="New South Wales"/>
        <s v=""/>
      </sharedItems>
    </cacheField>
    <cacheField name="City" numFmtId="0">
      <sharedItems count="7">
        <s v="Bendigo"/>
        <s v=""/>
        <s v="Caloundra"/>
        <s v="Cloverdale"/>
        <s v=" "/>
        <s v="Cranbourne"/>
        <s v="Darlinghurst"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Postal Code" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Product Category" numFmtId="0">
      <sharedItems count="1">
        <s v="Bikes"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Product Subcategory" numFmtId="0">
      <sharedItems count="2">
        <s v="Road Bikes"/>
        <s v="Mountain Bikes"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Product Name" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Product Description" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Promotion Category" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Promotion" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Promotion Type" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Year" numFmtId="0">
      <sharedItems count="1">
        <s v="2001"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Quarter" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" containsInteger="1" minValue="3" maxValue="3"
        count="1">
        <n v="3"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Month" numFmtId="0">
      <sharedItems count="3">
        <s v="September"/>
        <s v="July"/>
        <s v="August"/>
      </sharedItems>
    </cacheField>
    <cacheField name="Currency" numFmtId="0">
      <sharedItems/>
    </cacheField>
    <cacheField name="Order Quantity" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" containsInteger="1" minValue="1"
        maxValue="1"/>
    </cacheField>
    <cacheField name="Unit Price" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="699.09820000000002"
        maxValue="3578.27"/>
    </cacheField>
    <cacheField name="Extended Amount" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="699.09820000000002"
        maxValue="3578.27"/>
    </cacheField>
    <cacheField name="Discount Pct" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" containsInteger="1" minValue="0"
        maxValue="0"/>
    </cacheField>
    <cacheField name="Discount Amount" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" containsInteger="1" minValue="0"
        maxValue="0"/>
    </cacheField>
    <cacheField name="Product Standard Cost" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="413.1463" 
        maxValue="2171.2941999999998"/>
    </cacheField>
    <cacheField name="Total Product Cost" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="413.1463"
        maxValue="2171.2941999999998"/>
    </cacheField>
    <cacheField name="Sales Amount" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="699.09820000000002"
        maxValue="3578.27"/>
    </cacheField>
    <cacheField name="Tax Amount" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1"
        minValue="55.927900000000001" maxValue="286.26159999999999"/>
    </cacheField>
    <cacheField name="Freight" numFmtId="0">
      <sharedItems containsSemiMixedTypes="0" containsString="0"
        containsNumber="1" minValue="17.477499999999999"
        maxValue="89.456800000000001"/>
    </cacheField>
  </cacheFields>
</pivotCacheDefinition>

In the context of <pivotCacheDefinition>:

  • @r:id indicates the relationship id pointing to the corresponding pivotCacheRecords part.

  • @refreshedBy indicates the username of whomever last refreshed the PivotCache.

  • @refreshedDate indicates when the PivotCache was last refreshed.

  • @createdVersion indicates the version of the producer which created the PivotCache.

  • @refreshedVersion indicates the version of the producer which last refreshed the PivotCache.

  • @minRefreshableVersion indicates the minimum version of the producer required to be able to refresh this PivotCache.

In the context of <cacheSource>:

  • @type indicates that data in a worksheet is the source for this PivotCache.

  • @worksheetSource identifies the particular location of the source data. In this case, it is a named range whose name is "Table1".

In the context of <cacheFields>, which is a collection of all the field definitions in the source data:

  • @cacheField indicates the name of the field and provides number format information.

In the context of <cacheField>:

  • @sharedItems indicates various flags about the data in this field. Child elements express the values of the shared items.

In the context of <sharedItems>:

  • @containsSemiMixedTypes "1" indicates that this field contains text values possibly mixed with other types of values, this can contain blanks. In this example the value is "0".

  • @containsString value of "1" indicates that this field contains a text value. In this example, the value is "0".

  • @containsNumber value of "1" indicates that this field contains numeric values.

  • @containsInteger indicates that this field contains integer values.

  • @minValue indicates that this field's minimum value is "3".

  • @maxValue indicates that this field's maximum value is "3".

  • @s indicates string content for this item value (expressed in @v).

  • @n indicates the numeric content for this item value (expressed in @v).

If there are no shared items expressed for a particular field, then the values are expressed directly in the pivotCacheRecords part.

Items in the PivotCacheDefinition can be shared, in order to reduce the redundancy of those values, since they're referenced in multiple places across all the PivotTable parts. For example, a value might be part of a filter, it might appear on a row or column axis, and will appear in the pivotCacheRecords definition as well. However, because of the performance cost of creating the optimized shared items, items are only shared if they are actually in use in the PivotTable. Therefore, depending on user actions on the PivotTable layout, the pivotCacheDefinition and underlying PivotCacheRecords part may be updated.