2.2.5.2.2 Cache Fields
A cache field represents an entity by which data can be summarized. An example of such an entity is country/region. Having a country/region cache field enables users to summarize data by country/region.
Consider a PivotCache (section 2.2.5.2) based on the following source data (section 2.2.5.2.1):
Country/Region |
Product |
Date |
Sales |
---|---|---|---|
USA |
Bicycle |
6/5/2007 |
500 |
USA |
Car |
8/3/2007 |
20000 |
Canada |
Bicycle |
9/2/2007 |
300 |
Canada |
Car |
10/5/2007 |
35000 |
In this example, four cache fields exist in the PivotCache. Each cache field corresponds to one of the columns (1) in the source data: Country/Region, Product, Date and Sales.
The sequence of records that conform to the PCDFIELD rule (defined in section 2.1.7.38) specifies a cache field. A cache field is contained in a PivotCache.
The sequence of records that conform to the PCDFIELDS rule (defined in section 2.1.7.38) specifies all cache fields of the PivotCache.
A cache field index is a zero-based index of a PCDFIELD rule in the sequence of records specified by the PCDFIELDS rule.
A cache field typically corresponds to a source data column (1) or to a level of an OLAP hierarchy. However, grouping (section 2.2.5.2.4) cache fields and cache fields representing calculated fields (section 2.2.5.2.5) do not correspond to source data entities. Such cache fields are fully specified by information in the PivotCache.
The fSrcField field of the BrtBeginPCDField (section 2.4.136) record specifies whether the cache field corresponds to a source data entity. A non-OLAP PivotCache MUST have one or more cache fields corresponding to source data columns (1). An OLAP PivotCache MUST NOT have cache fields that do not correspond to source data entities.
All cache fields that do not correspond to source data entities MUST be located after cache fields that do correspond to source data entities in the sequence of records that conform to the PCDFIELDS rule.
In a non-OLAP PivotCache, a cache field corresponds to one column (1) in the source data and contains information about that column (1). The cache field name is specified by the stFldName field of the BrtBeginPCDField record. The cache field name of a cache field corresponding to a source data column (1) is derived from the name of the column (1) in the source data and is used to associate the cache field with the source data column (1).
A cache field name MUST be valid as specified by the stFldName field of the BrtBeginPCDField record.
Except for grouping (section 2.2.5.2.4) cache fields in non-OLAP PivotCaches, all cache field names MUST be unique, when using a case-insensitive comparison, within the PivotCache.
In an OLAP PivotCache, each cache field is associated with a cache hierarchy (section 2.2.5.2.7). Each cache hierarchy has an associated sequence of records that conform to the PCDHFIELDSUSAGE rule (defined in section 2.1.7.38) which specify the cache field indexes of the cache fields that are associated with that cache hierarchy. The cache hierarchy to which cache fields are associated is specified by the BrtBeginPCDHierarchy (section 2.4.146) record preceding the sequence of records that conform to the PCDHFIELDSUSAGE rule.
If a cache hierarchy (section 2.2.5.2.7) is not a measure (section 2.2.5.2.7.1) or a named set (section 2.2.5.2.7.3) there can be more than one cache field associated with it. Each cache field corresponds to an OLAP level or to a member property of the associated OLAP hierarchy in the source data (section 2.2.5.2.1). The fOlapMemPropField of the BrtBeginPCDField (section 2.4.136) record specifies whether a cache field is a member property.