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="..." attribute, otherwise a new subset is created.

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.
@Hierarchy Optional, the hierarchy of the subset. If the hierarchy is missing, the default hierarchy is used.
@User Read-only, user name of creator.
@Name Read-only, unique name assigned by OLAP Database Worker in PutSubsetDefinition.

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

@Public Optional, "true" or "false". The default is "false".
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 Zero or more static subsets.
Alea:AttributeQuerys Zero or more definitions of attribute-driven subsets.
Alea:DataQuery Zero or more definitions of data-driven subsets.

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

Static subsets

This table describes static subsets:

XML object Description
Alea:PickList
Alea:Element One or more elements.
@Name Required, the name of the 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. Non-available elements are filtered out.

Attribute-driven subsets

This table describes an attribute-driven subset:

XML object Description
Alea:AttributeQuery
@AttribTableID 1-based ID of the attribute table.
@User Read-only, user name who created the subset, returned in answer.
Alea:AttrConditionGroup One or more condition groups. Condition groups are combined with the OR operator.
Alea:AttrCondition One or more conditions. Conditions within one ConditionGroup are combined with the AND operator.
@Operator Required, comparison operator. The possible values are:

"EQ" - Attribute = Value

"GE" - Attribute >= Value

One or more "GT" - Attribute > Value

"LE" - Attribute <= Value

"LT" - Attribute < Value

"NE" - Attribute <> Value

"LIKE"

"Enumeration"

"OpenInterval"

"ClosedInterval"

@FieldName Required, attribute field name.
@FieldType Optional, added automatically during the conversion of old subsets into XML format.
Alea:Value Used in comparison specified by @Operator.

This is a simplified example:

<Alea:AttributeQuery>
  <Alea:AttrConditionGroup>
    <Alea:AttrCondition Operator="EQ" FieldName="ATT1">
      <Alea:Value>V1</Alea:Value>
    </Alea:AttrCondition>
    <Alea:AttrCondition Operator="GT" FieldName="ATT2">
      <Alea:Value>1</Alea:Value>
    </Alea:AttrCondition>
  </Alea:AttrConditionGroup>
  <Alea:AttrConditionGroup>
    <Alea:AttrCondition Operator="LT" FieldName="ATT3">
      <Alea:Value>4</Alea:Value>
    </Alea:AttrCondition> 
  </Alea:AttrConditionGroup>
</Alea:AttributeQuery>

Elements become a member of a subset if:

(ATT1 = 'V1' AND ATT2 > 1) OR  (ATT3 < 4)

Data-driven subsets

This table describes data-driven subsets:

XML object Description
Alea:DataQuery
Alea:DataArea Required, one instance of dataquery definition.
@Cube Required, name of cube used in query.
@NonExistentCellSuppression Required. This XML attribute can be True or False. It specifies if empty cells are included in the respective query. A special case is that a string cell can contain an empty string. That is not the same as an empty cell.
@UseOnlyBasicElements Required, "true" or "false".
Alea:PickList Zero or more picklists restricting the data area.
@Dimension Required, name of the restricted dimension.
Alea:Element One or more elements of the restricted dimension.
@Name Required, name of the element.
Alea:Condition One or two conditions applied on each cell from the data area.
@Operator Required, comparison operator. The possible values are:

"EQ" - Cell = Value

"GE" - Cell >= Value

"GT" - Cell > Value

"LE" - Cell <= Value

"LT" - Cell < Value

"NE" - Cell <> Value

Alea:Value Value used in comparison specified by @Operator.

Example 1

This example shows a static subset of 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 a static subset of 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>

Example 3

This example shows an attribute-driven subset.

Request

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="2" Class="Dimension" Method="PutSubsetDefinition">
    <Alea:Dimension Name="PRODUCT">
      <Alea:Subset Public="true">
        <Alea:Description>ExampleSubset2</Alea:Description>
        <Alea:Union>
          <Alea:AttributeQuery AttribTableID="1">
            <Alea:AttrConditionGroup>
              <Alea:AttrCondition Operator="GT" FieldName="PRODUCTI">
                <Alea:Value>17</Alea:Value>
              </Alea:AttrCondition>
            </Alea:AttrConditionGroup>
          </Alea:AttributeQuery>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Dimension>
  </Alea:Request>
</Alea:Document>

Answer

<Alea:Document>
  <Alea:Request RequestID="2">
    <Alea:Return>
      <Alea:Subset Public="true" Dimension="PRODUCT" Name="       6" User="Admin" Hierarchy="PRODUCT">
        <Alea:Description>ExampleSubset2</Alea:Description>
        <Alea:Union>
          <Alea:AttributeQuery AttribTableID="1">
            <Alea:AttrConditionGroup>
              <Alea:AttrCondition Operator="GT" FieldName="PRODUCTI">
                <Alea:Value>17</Alea:Value>
              </Alea:AttrCondition>
            </Alea:AttrConditionGroup>
          </Alea:AttributeQuery>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Return>
  </Alea:Request>
</Alea:Document>

Example 4

This example shows a data-driven subset.

Request

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="3" Class="Dimension" Method="PutSubsetDefinition">
    <Alea:Dimension Name="PRODUCT">
      <Alea:Subset Public="true">
        <Alea:Description>ExampleSubset3</Alea:Description>
        <Alea:Union>
          <Alea:DataQuery>
            <Alea:DataArea Cube="ANALYSIS" NonExistentCellSuppression="true" UseOnlyBasicElements="true">
              <Alea:PickList Dimension="Period">
                <Alea:Element Name="2016_Q1_01" />
              </Alea:PickList>
              <Alea:PickList Dimension="POS">
                <Alea:Element Name="Bodyshops" />
              </Alea:PickList>
              <Alea:PickList Dimension="REGION">
                <Alea:Element Name="Norway" />
              </Alea:PickList>
              <Alea:PickList Dimension="CHANNEL">
                <Alea:Element Name="Direct Sales" />
              </Alea:PickList>
              <Alea:PickList Dimension="VALTYPE">
                <Alea:Element Name="Actual" />
              </Alea:PickList>
              <Alea:PickList Dimension="MEASURE">
                <Alea:Element Name="Units" />
              </Alea:PickList>
            </Alea:DataArea>
            <Alea:Condition Operator="GT">
              <Alea:Value>100</Alea:Value>
            </Alea:Condition>
            <Alea:Condition Operator="LT">
              <Alea:Value>400</Alea:Value>
            </Alea:Condition>
          </Alea:DataQuery>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Dimension>
  </Alea:Request>
</Alea:Document>

Answer

<Alea:Document>
  <Alea:Request RequestID="3">
    <Alea:Return>
      <Alea:Subset Public="true" Dimension="PRODUCT" Name="       7" User="Admin" Hierarchy="PRODUCT">
        <Alea:Description>ExampleSubset3</Alea:Description>
        <Alea:Union>
          <Alea:DataQuery>
            <Alea:DataArea Cube="ANALYSIS" NonExistentCellSuppression="true" UseOnlyBasicElements="true">
              <Alea:PickList Dimension="Period">
                <Alea:Element Name="2016_Q1_01"/>
              </Alea:PickList>
              <Alea:PickList Dimension="POS">
                <Alea:Element Name="Bodyshops"/>
              </Alea:PickList>
              <Alea:PickList Dimension="REGION">
                <Alea:Element Name="Norway"/>
              </Alea:PickList>
              <Alea:PickList Dimension="CHANNEL">
                <Alea:Element Name="Direct Sales"/>
              </Alea:PickList>
              <Alea:PickList Dimension="VALTYPE">
                <Alea:Element Name="Actual"/>
              </Alea:PickList>
              <Alea:PickList Dimension="MEASURE">
                <Alea:Element Name="Units"/>
              </Alea:PickList>
            </Alea:DataArea>
            <Alea:Condition Operator="GT">
              <Alea:Value>100</Alea:Value>
            </Alea:Condition>
            <Alea:Condition Operator="LT">
              <Alea:Value>400</Alea:Value>
            </Alea:Condition>
          </Alea:DataQuery>
        </Alea:Union>
      </Alea:Subset>
    </Alea:Return>
  </Alea:Request>
</Alea:Document>