开发者

SSRS 2008 R2 Charts: Selective Filtering on Chart Series

开发者 https://www.devze.com 2023-04-12 12:41 出处:网络
Say I have 3 Chart Series A,B,C of Dat开发者_StackOverflow社区a onsingle Chart Normally When I apply filter on Category Group CG ,the filter takes affect on all 3 series A,B,C .What I need is someway

Say I have 3 Chart Series A,B,C of Dat开发者_StackOverflow社区a on single Chart

Normally When I apply filter on Category Group CG ,the filter takes affect on all 3 series A,B,C .What I need is someway to apply particular filter on Series A,B but not C

Is it possible?


As noted in the question filtering a category group filters all the chart data, not just a single series. So the filter functionality on the chart cannot be used for this. However, it is possible to achieve the same effect as filtering just one series of a chart by using calculated columns. In short: you need to add calculated columns which contain only the data you need for their respective series.

Let's use a simple example to explain how this works. Image you need to display a "USD currency rate" using an Area chart combined with a "EUR currency rate" using a Line chart.

Add a calculated field called Rate_USD using following expression:

=IIF(Fields!CurrencyAlternateKey.Value = "USD", Fields!EndOfDayRate.Value, 0)

Add a second calculated field called Rate_EUR using this:

=IIF(Fields!CurrencyAlternateKey.Value = "EUR", Fields!EndOfDayRate.Value, 0)

Now use these two fields in the Values box of the chart to create two separate, filtered series.


I'm guessing you are applying a filter to the chart as a whole, to fix this you need to adjust your filters to apply only to the desired series.

Taken from the msdn: "To filter data points in a chart, you can set a filter on a category group or a series group."

To set a filter on a Chart series group

Open a report in Design view.

On the design surface, click the chart twice to bring up data, series and category field drop zones.

Right-click on a field contained in the series field drop zone and select Series Group Properties.

Click Filters. This displays the current list of filter equations. By default, the list is empty.

Click Add. A new blank filter equation appears.

In Expression, type or select the expression for the field to filter. To edit the expression, click the expression (fx) button.

From the drop-down box, select the data type that matches the type of data in the expression you created in step 5.

In the Operator box, select the operator that you want the filter to use to compare the values in the Expression box and the Value box. The operator you choose determines the number of values that are used from the next step.

In the Value box, type the expression or value against which you want the filter to evaluate the value in Expression.

Click OK.

0

精彩评论

暂无评论...
验证码 换一张
取 消