Example of a manually created slice

This example uses these functions to create a slice:

  • CREATESLICELIST
  • CREATESLICELISTSEGMENT
  • CREATESLICELISTAXIS
  • INITSLICERS
  • CREATESLICEDEFINITION

You can use other slice functions to modify the slice. For example, use SLICEAXISADDFILTERS to filter the values on the slice axes.

This example uses a data connection to create a slice. The slice has the first and second quarters of 2016 on the rows and the Units element of the Measure hierarchy on the columns. In this example, the data connection is named BPT.

  1. Create a report.
  2. In B1, specify [repository].[BPT].[analysis].[period]. Optionally, for your reference, specify Row hierarchy in A1.
    [repository].[BPT].[analysis].[period] is the unique name of the Period hierarchy in the OLAP metadata hierarchy.
  3. In B2, specify [repository].[BPT].[analysis].[measure]. In A2, specify Column hierarchy.
  4. In B3, specify =CREATESLICELIST("[repository].[bpt].[analysis].[period]", "{[period].[all years].[2016].[2016_Q1],[period].[all years].[2016].[2016_Q2]}"). In A3 , specify Row list.
  5. In B4, specify =CREATESLICELIST("[repository].[bpt].[analysis].[measure]", "{[measure].[units]}"). In A4, specify Column List.
  6. In B5, specify =CREATESLICELISTSEGMENT("[repository].[bpt].[analysis].[period]",B3). In A5, specify Row segment.
  7. In B6, specify =CREATESLICELISTSEGMENT("[repository].[bpt].[analysis].[measure]",B4). In A6, specify Column segment.
  8. In B7 specify =CREATESLICEAXIS("[repository].[bpt].[analysis].[period]", "none", B5). In A7, specify Row axis.
  9. In B8, specify =CREATESLICEAXIS("[repository].[bpt].[analysis].[measure]", "none", B6). In A8, specify Column axis.
  10. In B9, specify =INITSLICERS("[repository].[bpt].[analysis]", "[repository].[bpt].[analysis].[period]","[repository].[bpt].[analysis].[measure]")
    This creates an XML list of all dimensions in the Analysis cube, except the row and column dimensions.
  11. In B10, specify =CREATESLICEDEFINITION("BPT", "Analysis", B9,B7,B8)
  12. Create a report variable named rv_slice.
  13. Pass the result of the CREATESLICEDEFINITION function in B10 to rv_slice.
    For example, create a Set parameters action and select rv_slice as the Name parameter and =B10 as the value.
  14. In the Accessories pane, create a variable slice with rv_slice as the source variable.
  15. Drag the slice to the report.