Using functions to create the XML for a variable slice

You can create a slice with a minimum of four slice functions. You can use further functions to add, for example, sorting or attributes to the axes of a slice.

This topic describes the basic process to create an XML variable for use as a slice.

  1. Decide which hierarchies will form the columns and rows of the slice, and which will be the slicer hierarchies.
  2. Use CREATESLICELISTS or CREATESLICELIST to create the lists to display on the rows and columns of the slice.
    For example, to display two lists on the rows and two lists on the columns, use two CREATELISTS functions - one to create the row lists and one to create the column lists. CREATESLICELISTS requires an array of hierarchies, and the MDX definitions of those hierarchies.
  3. Use CREATESLICELISTSEGMENT functions to create a segment for the rows and a segment for the columns.
    CREATESLICELISTSEGMENT references the array of hierarchies, and the output of the CREATESLICELISTS function.
  4. Use CREATESLICEAXIS functions to create the row and column axes of the slice.
    CREATESLICEAXIS references the array of hierarchies and the output of the CREATSLICESEGMENT function.
  5. Use CREATESLICEDEFINITION to create the slice definition.
    CREATESLICEDEFINITION references the outputs of the CREATESLICEAXIS functions and a list of slicer hierarchies.

    For example, use INITSLICERS to create an xml list of the slicer hierarchies.

  6. Pass the output of CREATSLICEDEFINITION to a variable and select the variable in the New Slice dialog.