Creating an attribute-driven hierarchy

You can use the Dimension Write request to create an attribute-driven hierarchy.

In this request, AttributeLevel/TableID is 0-based. As opposed to that, in the CreateAttributeTable and ImportAttributeValues requests, AttributeTable ID is 1-based.

Request

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="3" Class="Dimension" Method="Write">
    <Alea:Dimension Name="Product" FirstBatch="true" LastBatch="true">
      <Alea:DimensionTemplate Name="Product" />
      <Alea:Hierarchy Name="Size2" SourceHierarchy="Product">
        <Alea:TopLevel Element="All sizes" />
        <Alea:AttributeLevel TableID="0" AttributeName="SIZE" EmptyValueElement="Unknown size" />
        <Alea:BaseLevel Hidden="false" /> 
      </Alea:Hierarchy>
    </Alea:Dimension>
  </Alea:Request>
</Alea:Document>

The hierarchy is defined in multiple steps. At first, the root level is defined (Alea:TopLevel). It contains the name of the top element (Alea:TopLevel/Element). This level is optional. A hierarchy without this level might have multiple root members.

This is followed by zero or more levels that are based on attributes (Alea:AttributeLevel). The necessary information is the number of the attribute table (Alea:AttributeLevel/TableID) and the name of the attribute (Alea:AttributeLevel/AttributeName). Optionally, a name can be defined that is used in the case that the attribute is not correctly defined (Alea:AttributeLevel/EmptyValueElement). This element name is used if the attribute value cannot be used as an element name. This can happen in multiple situations like invalid characters, relations that violate the tree structure or non-unique element names. If no attribute level is defined, the base elements are children of the Alea:TopLevel element - if that is defined. If the EmptyValueElement is not specified, or it is not usable, a name is generated. The members on the base level of this hierarchy (Alea:BaseLevel) are defined by one of the hierarchies created from parent-child relations. The name of that hierarchy is stored in this tag (Alea:Hierarchy/SourceHierarchy).