Compartilhar via


2.2.4.1.1.2.1.2.5 KeyNormType Complex Type

The KeyNormType type<43> is a collection of two simple elements that represents the keys of all the distinct members in a hierarchy.

 <xsd:complexType name="KeyNormType">
   <xsd:sequence>
     <xsd:element name="DistinctCountMember" type="xsd:string" minOccurs="1" maxOccurs="1" />
     <xsd:element name="Data" type="xsd:base64Binary" minOccurs="0" maxOccurs="unbounded" />
   </xsd:sequence>
 </xsd:complexType>

Element

Description

DistinctCountMember

Indicates the distinct count of keys in the hierarchy.

Data

Keys of the distinct members of the hierarchy are represented in an optimized format. Please see the format details that follow about how the keys are stored.

The following format details specify how the tuples are optimized within the Data element:

  • The Data element contains the keys for each level of the hierarchy. If the key is of type String, the key has a variable length. For keys that are not strings, the size can be estimated by multiplying the number of distinct members by the value 9 (1 byte for data type, 4 bytes for offset, and 4 bytes for DisplayInfo).

  • If the data type is not a string, the next 8 bytes are used to represent the data, irrespective of the data type.

  • If the data type is a string, the length of the string is indicated by 4 bytes followed by the string.

  • If the string is an empty string, it is represented by the value -1.

  • Clients are expected to use the KeySet information to form the UniqueName of the member by using the HierUName information in the metadata and appending that result by using an opening square bracket ([), a KeyValue from the KeySet, and a closing square bracket (]). For example, if the UniqueName of a hierarchy is specified as [Customer].[CustomerID], the UniqueName for "Customer ID = 1" can be formed as [Customer].[CustomerID].[1]. Clients can use the value that is specified in MemberFormatString to format the members in the hierarchy.

  • If there is a null string, the key is expected to be specified as an empty set of square brackets ([]).

  • Once the UniqueName for each member in a hierarchy is formed, the tuple can be constructed by combining the unique names of each member and the offset that is specified in the TupleSet.

    For example, if an axis contains two hierarchies as follows:

    • Month hierarchy with HierUName.[Calendar].[Month] with distinct members Null, Jan, Feb, and Mar.

    • Year hierarchy with HierUName.[Date].[Year] with values {Null, Jan, Feb, Mar} and {2010, 2011, 2012}.

    Then, a tuple such as ([Calendar.Month].[Jan], [Date].[Year].[2011]) can be formed by using the value in KeySet and the offset value in the Data element of TupleSet.