I am trying to add an indicator in Report Builder to show on my report using 2 fixed conditions. the first condition is if the description of a field = "Compensation", the second being if a field date is >= Now(). It should then go red after 5 days.
I have added the indicator and in the Value and States tab, for Value I have added =(Fields!Description.Value ="Compensation")
For the indicator: Color Expression is "Yellow"
Start expression is =(fields!StartDate.value >=Now())
End expression is =(fields!StartDate.Value =Now()+5)
when I run the report, where the indicatr should be, I get text that reads "An error has occurred during data evaluation of the GaugePanel'GaugePanel5'.
Hope I've explained in enough detail.
Is anyone able to offer any advice on indicators please?
Thanks
I ended up using an expression under fill in Textbox Properties instead of adding an indicator which is giving me the required results. Example =IIF(Fields!ComplaintStageDescription.Value = "Stage0", "yellow", IIF(Fields!ComplaintStageDescription.Value = "Stage3", "white", IIF(Sum(Fields!DaysOpen.Value) < 5 ,"lime", IIF(Sum(Fields!DaysOpen.Value) < 10, "yellow" ,"red"))))
Related
I have a matrix in my SSRS 2016 reporting services report. I am trying to set a conditional expression on background color for the sum(field.value). This field is formatted as a percent. Here is my expression which does not appear to have any errors:
Background Color Expression:
=Switch(Fields!PicturesbeforeFirstSignoutCount.Value<.80,"Red",Fields!PicturesbeforeFirstSignoutCount.Value >= .80 and Fields!PicturesbeforeFirstSignoutCount.Value < .95,"Yellow",Fields!PicturesbeforeFirstSignoutCount.Value >= .95,"lightGreen")
Problem: It turns everything "lightgreen" even when their textbox should be yellow's and red's in the matrix. there is one field that is highlighted as Red, but it should have been Yellow.
I tried to set this in the field property for background color expression. That just made everything "light green".
I changed it to the fill expression in the matrix Text box. Now I get mostly everything green except the one red field that should be yellow. I checked my numeric values and they are coming across in decimals points when I change the format back to number
Any help would be appreciated.
As Harry mentioned in the comments, you need to be evaluating the same expression as you are displaying.
Also you can simplify the SWITCH statement as follows.
=SWITCH(
SUM(Fields!PicturesbeforeFirstSignoutCount.Value) <.80, "Red",
SUM(Fields!PicturesbeforeFirstSignoutCount.Value) < 0.95, "Yellow",
True ,"LightGreen"
)
As SWITCH returns the first result where the expression is true, there is no need to put a range in. so if the value was 0.91 then the first expression would be skipped but the second one would be true to it would return "Yellow".
The final True acts as an "else".
iam building a PIE CHART in report builder , need to make one pie chart visible on some condition &click
by clicking on categories piechart latitude model pie chart should appear but on condition if in categories virtualcount>0.
so following expression iam entering in vsibility expression
=IIf(Sum(Fields!virtualcount.Value, "DataSet1")>0,1,0)
When I run report, it gives me following error
You need to use True and False instead of 1 and 0.
Also keep in mind that the property you are setting is called Hidden, meaning a value of True will hide the chart, and a value of False will not hide the chart. From your question, it is unclear to me if you want the chart displayed or hidden when that condition is met. I think you want the 0 and 1 from your expression flipped the other way around, but like I said, it is unclear to me. If this expression does not give you the desired output, try reversing the True and False:
=IIf(Sum(Fields!virtualcount.Value, "DataSet1") > 0, False, True)
The following expression to show/hide subreport is not working.
=iif((DateAdd("d", 45, Fields!actualclosingdate.Value) > Today()), True, False)
Any suggestions, alternatives, or advice will be greatly appreciated.
Please try to put the subreport into a rectangle and set the visibility of that rectangle.
Most of the times issue with the SSRS value matching expressions are the data types of the values that creates the problems or undesired result. In your case your actualclosingdate field might be coming as the string so you need to make sure that it is convert back to the Date before adding days to it. For that matter always right your expressions in SSRS using type conversion so your expression can be on safer side.
And I am also assuming that your requirement is,
If the actual closing date +45 days is greater than Today then hide the report and if not then show.
SO Subreport->RightClick->Proprties->Visibility->Show/hide based on expression
=IIF((DateAdd("d", 45,CDate(Fields!actualclosingdate.Value)) > Today()), True, False)
I have a question, want some assistance.
Q) My question is that i have a chart in which analyst assigned for many incidents and some analyst have 1 or two incident assigned. just because of this the bar chart looks ugly some time. So thats why i used a new chart to represent Min incident count. But i want there some creativeness, for which i want there a radio button or OnClick event ( I do not know how to use both these. When report runs by default it`ll show Max incidents count chart and when we used radio button it will show Min incidents count chart, on the same chart area no need of new area or on new page.
Kindly help me or refer me some links and with ideas. As i have searched many blogs but i didn`t get any big achievement.
Below is my Simplified query;
SELECT
Count(IncidentDimvw.Id)
,UserDimvw.FirstName AS Analyst
FROM
IncidentDimvw
FULL JOIN WorkItemDimvw
ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey
JOIN WorkItemAssignedToUserFactvw
ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
JOIN UserDimvw
ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = UserDimvw.UserDimKey
WHERE
WorkItemAssignedToUserFactvw.DeletedDate IS NULL
GROUP BY
UserDimvw.FirstName
Having (Count(IncidentDimvw.Id) = (#Count))
Having Clause is right or wrong, i donot know.
I used the following expresion in series as you suggested.
=iif(Parameters!Count.Value, Max(Sum(Fields!ID.Value)), Min(Sum(Fields!ID.Value)))
Sample data is as folows;
Regards
Muhammad Ahsan
I can think of a couple of ways to approach this:
Dynamic expressions based on parameter
Say you have a simple DataSet like:
And also a boolean parameter called showMax.
We can create a simple bar graph based on this:
The most important thing to note is that Series value is expression-based:
In the above example the expression is:
=IIf(Parameters!showMax.Value
, Max(Fields!value.Value)
, Min(Fields!value.Value))
i.e. when showMax is true, report the Max values, otherwise report the min values.
In this case I've also updated the Axis title, Chart title, and Custom legend text to be expression-based:
Axis Title: =IIf(Parameters!showMax.Value, "Max", "Min")
Chart Title: =IIf(Parameters!showMax.Value, "Max per group", "Min per group")
Custom legend text: =IIf(Parameters!showMax.Value, "Max value", "Min value")
The chart behaviour changes based on what parameter is selected as required:
Set Visibility based on parameter
Another option is simply to have to charts and hide one depending on parameter selection.
For example, for the Max chart the Hidden property can be set to:
=Not(Parameters!showMax.Value)
Setting this property correctly for each report will mean only one is ever displayed to the user, i.e. it will look dynamic.
Either of these options should work; the first keeps the layout simple in the designer makes the chart more complex, the second makes the layout more complex but keeps the charts simple.
Hopefully one option will work for you.
I'm am having some trouble with conditional formatting in SSRS. I have tried Switch & IIF Statements (below). The report runs but is not returning colors as it I'm hoping it would. I'm trying to highlight dates which are <= today in red, and everything else will be black. Does it matter if this field is a date field? I've seeen other questions on here with the same issues but no resolutions. Was hoping today would be my lucky day to find an answer. Here is what I have tried and thank you in advance for any input.
=Switch( Fields!Decision_Must_Be_Made.Value <= today(), "Red",
Fields!Decision_Must_Be_Made.Value > today(), "Black")
=IIF( Fields!Decision_Must_Be_Made.Value <=today(), "Red", "Black")
Yes, it definitely matters if the field is a Date Time field. If it's a string, then you need to convert it to datetime first. How you do that will depend on the format of the string. But it will be much better if you can stick with a datetime field from the database. (I've seen where some will format a date to a string in the select of the sql query. Don't do that. Format as late as possible: in SSRS, at the text box level.)
If it is a dateTime, break up your formula to find out what's not working as expected and make it more visible, if only for debugging. Put this in the expression of a cell, for example:
=IIF( Fields!Decision_Must_Be_Made.Value <=today(), "Old", "New")
Edited to add information on where the color formula should be added:
Sounds like you don't have the IIF specifying the color in the right place. There are a few different places you could specify this: it needs to be in the properties of either the textbox or the placeholder. The value for these things should simply be your date field (=Fields.Decision_Must_Be_Made.Value) but the font color needs to be specified separately. One place to do this is in the Text Box Properties dialog. In the font pane, you need to specify the font color. The Fx symbol indicates that you can specify a formula. Click this button for a place to enter your '=iif...' formula.
Admittedly this does not answer your scenario but may help someone else. I had an issue where a stand-alone textbox using a scenario where I wanted to display an error message when there was either no record or duplicate records. My formula "=IIf(IsNothing(First(Fields!MyField.Value)) Or First(Fields!MyField.Value) <> Last(Fields!MyField.Value), "Red", "SomeOtherColorButNotBlack") which did not render the correct fore-color (came out "Black") however, doing a similar expression that equates to True or False on a Tablix or Matrix does work fine. Another one for MS to solve. I found my own workaround by setting the color to always be red and then the expression of the Text to be blank when no error.