Dimension PutSubsetDefinition

Creates or replaces a subset of a hierarchy.

If you create a new subset, do not define the internal subset name Alea:Subset Name="...".

If you replace a subset but do not change its Alea:Description, you can use this description for the identification of the subset as in GetSubsetDefinition.

If you rename an existing subset (Alea:Description changes), you must specify the Alea:Subset Name="..." XML attribute, otherwise a new subset is created.

You can create or edit only one subset per request. Additional subset definitions in a request are silently ignored by OLAP.
Note: The attribute-driven, data-driven, and private subsets are obsolete.

XPath syntax

Alea:Document is the XML element.

@Name is the attribute, member of last listed XML element.

This table describes the structure of an Alea:Subset XML element:

XML object Description
Alea:Subset Required, container for the subset definition.
@Dimension Read-only, dimension name, returned in the answer.
@Hierarchy Optional, the hierarchy of the subset. If the hierarchy is missing, the default hierarchy is used.
@User Read-only, user name of creator, returned in the answer.
@Name Read-only, unique name assigned by OLAP in PutSubsetDefinition.

Can be used by DeleteSubsetDefinition to delete or by another call of PutSubsetDefinition to update an existing subset.

@Public Required, must be "true", for backwards compatibility reasons.
Alea:Description Required, long name of the subset. Unique within the dimension.
@Language Optional, the only supported value is "Neutral".
Alea:Union Required, container for element selection.
Alea:PickList One or more subsets.
Alea:Element One or more elements.
@Name Required, name of the element.
(Alea:AttributeQuery) Obsolete.
(Alea:DataQuery) Obsolete.

The resulting subset is the union of all subsets defined in the Alea:Union XML element.

OLAP does not reject elements that do not exist or that are not visible to the user. The availability of the elements for the user is checked only at the time when the subset is used. Unavailable elements are filtered out.

Example 1

This example shows how to create a subset for the default hierarchy.

Request

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="1" Class="Dimension" Method="PutSubsetDefinition">
    <Alea:Dimension Name="REGION">
      <Alea:Subset Public="true">
        <Alea:Description>EUR</Alea:Description>
        <Alea:Union>
          <Alea:PickList>
            <Alea:Element Name="Austria" />
            <Alea:Element Name="Belgium" />
            <Alea:Element Name="France" />
            <Alea:Element Name="Germany" />
            <Alea:Element Name="Greece" />
            <Alea:Element Name="Ireland" />
            <Alea:Element Name="Italy" />
            <Alea:Element Name="Netherlands" />
            <Alea:Element Name="Portugal" />
            <Alea:Element Name="Spain" />
          </Alea:PickList>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Dimension>
  </Alea:Request>
</Alea:Document>

Answer

<Alea:Document>
  <Alea:Request RequestID="1">
    <Alea:Return>
      <Alea:Subset Public="true" Dimension="REGION" Name="5" User="Admin" Hierarchy="REGION">
        <Alea:Description>EUR</Alea:Description>
        <Alea:Union>
          <Alea:PickList>
            <Alea:Element Name="Austria" />
            <Alea:Element Name="Belgium" />
            <Alea:Element Name="France" />
            <Alea:Element Name="Germany" />
            <Alea:Element Name="Greece" />
            <Alea:Element Name="Ireland" />
            <Alea:Element Name="Italy" />
            <Alea:Element Name="Netherlands" />
            <Alea:Element Name="Portugal" />
            <Alea:Element Name="Spain" />
          </Alea:PickList>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Return>
  </Alea:Request>
</Alea:Document>

Example 2

This example shows how to create a subset for a non-default hierarchy.

Request

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="5" Class="Dimension" Method="PutSubsetDefinition">
    <Alea:Dimension Name="PRODUCT">
      <Alea:Subset Public="true" Hierarchy="Tire Size">
        <Alea:Description>Small</Alea:Description>
        <Alea:Union>
          <Alea:PickList>
            <Alea:Element Name="145" />
            <Alea:Element Name="155" />
            <Alea:Element Name="165" />
          </Alea:PickList>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Dimension>
  </Alea:Request>
</Alea:Document>

Answer

<Alea:Document>
  <Alea:Request RequestID="5">
    <Alea:Return>
      <Alea:Subset Public="true" Hierarchy="Tire Size" Dimension="PRODUCT" Name="8" User="Admin">
        <Alea:Description>Small</Alea:Description>
        <Alea:Union>
          <Alea:PickList>
            <Alea:Element Name="145" />
            <Alea:Element Name="155" />
            <Alea:Element Name="165" />
          </Alea:PickList>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Return>
  </Alea:Request>
</Alea:Document>