Example of SLICEAXISADDFILTERS

You use the SLICEAXISADDFILTERS function to add filters to a slice that has been created with slice functions. You cannot use it to add filters to slices that are created in the New Slice dialog box.

This example is based on the topic Example of a manually created slice.

  1. Create the slice described in the topic Example of a manually created slice.
  2. Create a report variable called rv_filterxml.
  3. In cell B12, specify:
    =SETPROPERTY("","key1","NodeType","Operator","OperatorType","AND","Enabled","True",
    "Nodetype","Filter","Enabled","True","Parent",1,"Aggregation","Any","FilterType","value","Includeotheraxis","False","value",35000000,"condition","GreaterThan",
    "Tuple","[measure].defaultmember,[period].defaultmember,[pos].defaultmember,[product].defaultmember,[region].defaultmember,[channel].defaultmember,[valtype].defaultmember",
    "set","{[measure].[gross margin]}")
  4. Pass the result of the SETPROPERTY function to rv_filterxml
    For example, create a Set parameters action in a cell.
  5. In cell B15, specify =SLICEADDAXISFILTERS(B7,ReportVariables.rv_filterxml.Text)
  6. In cell B17, specify =CREATESLICEDEFINITION("BPT", "Analysis", B9,B15,B8)
  7. Pass the result of the CREATESLICEDEFINITION to the rv_filterslice variable.
    For example, create a Set parameters action in a cell.
  8. Populate rv_filterxml and rv_filterslice
  9. Create a variable slice with rv_filterslice as the source. Drag the slice to the report.
    The slice displays Units only in the quarters in which the gross margin was greater than 35000000.