0

I have a table table of values displayed in SSRS . The table has fields metricID , currentmonth , preciousMonth

Questions :- 1. I have to compare 2 values like current month and previous month

Fields.PreviousMonth.Value < Fields.CurrentMonth.Value
  1. THEn Check if the metric id is metricID is 7 then increase in currentmonth should be displayed as up arrow with red colour else it should be downarrow with green colour.

  2. For all other Metric ID's it should be "upp arrow with green colour" else "down arrow with red colour"

Does anybody have an idea on how to do this

4

1 回答 1

1

To do this you will need to set up custom indicators and set an appropriate expression to set the indicator.

I have some simple data:

enter image description here

And a simple report with an indicator per row:

enter image description here

The indicator is set up as:

enter image description here

Where the expression is:

=Switch(Fields!MetricID.Value = 7 and Fields!CurrentMonth.Value - Fields!PreviousMonth.Value > 0, 1
    , Fields!MetricID.Value = 7, 2
    , Fields!MetricID.Value <> 7 and Fields!CurrentMonth.Value - Fields!PreviousMonth.Value > 0, 3
    , true, 4)

So what I'm doing is assigning each row a specified state based on your business rules, and I've set appropriate icons for each of those states.

Report is working as required:

enter image description here

You could move the expression above into a calculated field in the Dataset if you needed to use it in multiple places in the report.

于 2013-11-05T14:18:23.777 回答