Column Items

This collection is a listing of all the values on the column axis of the PivotTable. In this example, the item values are found in cells C6:H8. For example, "2001" / "3" / "July" values are in C7:C9. Those are the first column item values and are referenced by the first <i> element below.

<colItems count="5">
  <i>
    <x/>
    <x/>
    <x/>
  </i>
  <i r="2">
    <x v="1"/>
  </i>
  <i r="2">
    <x v="2"/>
  </i>
  <i t="default" r="1">
    <x/>
  </i>
  <i t="default">
    <x/>
  </i>
</colItems>

In the context of <colItems>:

  • <i> expresses all the values (for all fields) in one column of the column axis. There will be an <i> element for every column in the PivotTable column area.

In the context of <i>:

  • @r indicates how many fields/item values to "fill right" from the previous column.

Note that the first item has no @r explicitly written so the default value of "0" is implied.

In the context of <x>:

  • @v is a zero-based index referencing a <pivotField> item value. There will be as many <x >elements as there are item values in any particular column. Note that these <x >elements sometimes are not explicitly written, but instead "inherited" from the previous column/<i> element, via the value of @r. Note also that the pivotField items don't list values explicitly, but instead reference a shared item value in the pivotCacheDefinition part.

Note that the first instance of <x> has no attribute value v associated with it, so v's default value of "0" is implied.

The first <i> collection represents all item values for the first column in the column axis area of the PivotTable. The first <x> in the first <i> corresponds to the first field in the columns area of the PivotTable, namely "Year". The implied index value of '0' on this <x> indicates that the item value for this first item in the column is the 0th item for this pivotField. The 0th item for this pivotField is itself an index to an item value into this field's shared items collection in the pivotCacheDefinition part, namely "2001".

The item values corresponding to the second and third <x >elements can be found in the same way, arriving at "3" for the second item value, and arriving at "July" for the third item value for this first column.

The second <i> collection expresses all three item values for the second column in the column axis area. The @r value of '2' indicates that the first two item values from the previous column will be repeated here, which means that the first item value for this second column will be "2001" again and the second item value for this second column will be "3". The third item value is expressed by the only <x> element under this second <i> element, and without further explanation is understood to reference the item value "August".