Filter Measure Values in a Crosstab Report Sample
To filter measure values when data is summarized for
more than one dimension, such as in a crosstab or chart report,
you must specify more than one level in a summary filter.
In this sample, the summaryFilter
includes two summaryFilterLevel
elements
because the measure values that are filtered are summary values
at intersections of two level groups from different edges. The return
quantity filter is applied for two levels of grouping, Product type
and Order method. So there is one summaryFilterLevel
element
for each level.
Sample XML
The XML required to create this filter is highlighted in bold.
<report xmlns="http://developer.cognos.com/schemas/report/7.0/"
expressionLocale="en-us">
<modelPath>/content/package[@name='GO Sales and Retailers']
/model[@name='model']</modelPath>
<queries>
<query name="Query1">
<source>
<model/>
</source>
<selection>
<dataItem name="Product line" aggregate="none">
<expression>[gosales_goretailers].[Products].[Product line]</expression>
</dataItem>
<dataItem name="Product type" aggregate="none">
<expression>[gosales_goretailers].[Products].[Product type]</expression>
</dataItem>
<dataItem name="Order method" aggregate="none">
<expression>[gosales_goretailers].[Orders].[Order method]</expression>
</dataItem>
<dataItem name="Return quantity" aggregate="total">
<expression>[gosales_goretailers].[Orders].[Return quantity]</expression>
</dataItem>
<dataItem name="Total(Product type)">
<expression>total(currentMeasure within set [Product type])</expression>
</dataItem>
<dataItem name="Total(Order method)">
<expression>total(currentMeasure within set [Order method])</expression>
</dataItem>
</selection>
<summaryFilters>
<summaryFilter use="required">
<filterExpression>[Return quantity]>200</filterExpression>
<summaryFilterLevels>
<summaryFilterLevel refDataItem="Product type"/>
<summaryFilterLevel refDataItem="Order method"/>
</summaryFilterLevels>
</summaryFilter>
</summaryFilters>
</query>
</queries>
<layouts>
...
</layouts>
</report>