SSRS Conditional Formatting on Row Group - reporting-services

I've got a report that groups on Income, Non Payroll Expenditure and Payroll. Within each group there are separate rows for different categories.
I'd like to have a conditional formatting where if the YTD Variance column total <0, then its red, and if its >0 its green. I've tried numerous methods (Iif and Switch) but cannot get it to work.
This is the current expression I've got on background color.
=IIf(Fields!YTD_Variance.Value<0,"#fd6969","#54b322")
As can be seen in the image its not working correctly. Both of The YTD Variance totals should be red.

Assuming the total is an aggregate, something like =SUM(Fields!TYD_Variance.Value) then this is what you need to be evaluating.
Change your expression so that is compares the summed value, so something like this...
=IIf(SUM(Fields!YTD_Variance.Value) < 0, "#fd6969", "#54b322")

Related

Calculate total by summing max numbers

I have a Matrix report that has two row groups and two column groups. There is column which has the calculation Max(Fields!AdjustedManning.Value) on the Row Group level as a subtotal. I want to add a total at the bottom which is outside of the row group to sum the subtotal numbers up. What expression can I use to do this? Effectively I'm looking to sum the max numbers
In the image the yellow box for design is where I need to put the expression and a preview of what I would expect it to calculate.
Design and Preview
You didn't show the rowgroup names so I'm guessing you have a rowgroup grouped by [WoLine] called Woline. Assuming this is correct then you should be able to use something like...
=SUM(MAX(Fields!AdjustedManning.Value, "WoLine"))
"WoLine" is the name of the rowgroup, you must include the quotes and it is case sensitive so adjust to suit your actual report.
What this does is get the MAX value within the "WoLine" rowgroup scope and then sum the results.

How can I sum "Expr" in bottom of the table in SSRS?

I'm doing such a thing;
=Sum(Fields!TOTAL.Value) - Sum(Fields!IND.Value)
In cells, so this is end up with expresion "<<'Expr'>>", that means I'm finding net worth price - discount for each saled products, after that I want to sum all of those product's sales on bottom, like
=Sum(Sum(Fields!TOTAL.Value) - Sum(Fields!IND.Value) )
Any chance for that? I also tried like;
=Sum(ReportItems!TOTALBOX.Value)
But not work either.
Edit;
I'm doing something like that but on final, I want to sum those values which "<>" created.
Thx.
Since your data is in a Column Group (by [DEFINITION_] - the 3 columns with the line above them) you can create a total column using the same formula. The Total will SUM all the different DEFINITION groups for each [NAME] group.
You can add a column Outside the group and create your total column with the same formula
=Sum(Fields!TOTAL.Value) - Sum(Fields!IND.Value)
If you created everything correctly (and you're lucky), SSRS might be able to create the Total for you by right clicking on the cell and Add Total.

SSRS Stop RunningValue On Chart

I am creating a line chart to show sales prospecting data. I have 4 sets of values: Monthly Revenue at 100% confidence, Monthly Revenue adjusted to actual confidence %, Yearly Revenue at 100% confidence, and Yearly Revenue adjusted to actual confidence %. I'm using a RunningValue() function to calculate the "Yearly" values, both 100% and adjusted, which are separated as a Series Group on each year. The RunningValue is working perfectly, but I would like the line to end at the end of the year (or series), rather than plateauing through the rest of the graph. I'm thinking using an expression on the Pick Color selection, so that if the Year is greater than current running year, set it to No Color, but I'm not sure how to write that expression.
The highlighted yellow areas are what I would like to remove.
A minor supplemental question is, can I eliminate the doubling up of the legend that occurs from the Series Group separation, which I need to use because I want the separate line rather than having a drastic drop between years.
Add a condition to your running value expression so that it evaluates the year. I would use this on the value rather than the Color.
=IIF(YEAR(FIELDS!YourDateField.Value) <= YEAR(TODAY), <YOUR RUNNING TOTAL EXPRESSSION> , NOTHING)
Use de 'Field Scope' in the RunningValue() expression. This way, the ruuning 'resets' every year.
=RunningValue(Fields!MonthlyRevenue.Value,sum,"NameOfYearField")

How can I add an aggregate percentage to an SSRS report based on two specific columns in a matrix?

I am somewhat new to SSRS and I have built a matrix report that looks fairly simple:
Supplier [AccDate]
[SupplierName] Sum(PurchasingCredit)
Total <<Expr>>
The actual report shows month-by-month sales data for a year in addition to Current YTD and Previous YTD columns (joined via UNION clause in base query) in addition to a column showing Year-over-Year % as difference between the Current YTD and Previous YTD columns (also joined via union).
I was able to apply a dynamic format to the Year-over-Year column using the following expression in the Format property to show the YOY column as a percentage and the others as dollar amounts:
=IIF(Fields!AccDate.Value <> "YOY", "'$' #,0.00;'$' -#,0.00", "#,0.00 %;-#,0.00 %")
The last thing I need to do is to show the column totals, which are working for each column with the exception of the year-over-year percentages using the following:
=IIF(Fields!AccDate.Value <> "YOY", SUM(Fields!PurchasingCredit.Value), 0)
In the year-over-year (YOY) column, a sum of percentages doesn't make sense: I need it to recalculate this value based on the sums of the "CYTD" and "PYTD" columns, but I can't seem to figure it out. Any help would be greatly appreciated. I am guessing it is probably an application of scope, but the MS articles that attempt to explain this are very confusing.

Sum function in Report Builder 3.0

I am creating a report that will sum up all subtotal per MaterialNo/Color/Quality/Size.
Here's my sample report:
Computation will be GrandTotal = sum(Subtotal)
I am using =Sum(Fields!TOTAL_CTN.Value) but the result is 12.
Is there a way to compute using like =sum(subtotal_TextBoxName)?
I'm still not 100% sure of your underlying data and business logic, but here's one approach that might help.
I'm working off the following sample data:
Based on what your description above, it sounds like you have something similar to:
Which gives results:
It seems that you don't actually want to Sum TOTAL_CTN, rather this should be the same for every MaterialNo with the Sum only applied in the Grand Total.
As such you can change the Sub Total aggregation to Max and, since you're using Report Builder 3.0, you can then take the Sum of the group level aggregation values. The report will look like this:
Where the Grand Total expression is:
=Sum(Max(Fields!TOTAL_CTN.Value, "MaterialNoMax"))
In this expression MaterialNoMax refers to the name of the Row Group (based on MaterialNo in my example).
This gives your desired results:
The key here is thinking about what aggregation gets applied at each level and how these roll up to the end total.