SSRS get value from specific row and column - reporting-services

What I would like to get is the Gross Margin % of the Revised Budget cell (11%) and place in a text box at the top of the page so it stands out a little more.
This is my current dataset output and also what is rendered in the table.
Header
Original Budget
Change Orders
Revised Budget
Contract Value
1000
0
1000
Labor
500
500
100
Gross Margin %
10%
10%
11%
I have tried using some IIF statements but that seems to only pull from the aggregate of the dataset and have looked at the LOOKUP function but that seems to only target a row.
Something I tried that isn't working - doesn't look right anyway
=Fields!Header.Value = "Gross Margin %" and Fields!Revised_Budget.Value = "Revised Budget"
If someone could point me in the direction of the correct function that would be great.
Running SSRS 2012.
Here is the report design

The row you need the value from is a group total, then you should be able to use the ReportItems collection and add a reference to actual textbox.
In your example, click the cell that you want to repeat (the one at the bottom of your report) and find its name from the properties panel, some like TextBox99.
Then in the textbox at the top, set the expression to
=ReportItems!textBox99.Value
That should be it.

I ended up using the Lookup function. The first value is name of the value from the Header column that I was looking for. The last value is the which data I want to return and that is the Revised_Budget value from the ProjectCosts dataset.
=LOOKUP(
"Gross Margin %",
Fields!Header.Value,
Fields!Revised_Budget.Value, "ProjectCosts"
)

Related

Creating a percentage in an expression

Would like to have some text in my report like the following where the percentage is based on an expression. I would like to know how to work out the percentage.
60% of letters were sent with a first class stamp
This is an example of the figures I'm working with
First Class 300
Second Class 150
Other 50
The fields used are 'StampType' and 'RefNo'. The totals are gathered by a count on the 'RefNo'
To do this, do the following steps.
First, add a new Text Box to the report. Click inside the text box so the cursor shows inside. Right-click and choose Create Placeholder.... Enter the following expression for the Value field.
=Lookup("First Class", Fields!StampType.Value, Fields!RefNo.Value, "ReportMain") / Sum(Fields!RefNo.Value, "ReportMain")
This assumes the dataset name that is returning your data is named ReportMain. Change this if needed.
This looks up the First Class RefNo value from the dataset, and then divides that by the total of the RefNo in the dataset.
Go to the Number section of the dialog, change the Category to Percentage. Adjust the Decimal places to your liking. Click OK.
Type the text you want to follow that value after the placeholder (not in the placeholder) in the text box. Like this:
Preview the report, and you should have what you need.

How to subtract two textBoxes of ssrs report?

In footer I have 2 textboxes named curTotal and sub_total.
In header I have third textbox named result.
What I want to do is to subtract values of footer: result = sub_total - curTotal;
curTotal expression is (=sum(reportitems!lineamount1.value))
and
sub_total expression is (=Last(ReportItems!runningTotal.Value))
"runningTotal" is a field in tablix which has expression (=RunningValue(Fields!LineAmount.Value, SUM, "SalesInvoiceDS"))
I have tried to add to result expression following (=reportitems!sub_total.value - reportitems!curTotal.value) but it gives error that textbox refers to several report elements.
Please guide me how to correctly perform Math functions like subtract, multiple, division etc... with textBoxes in footer / header.
Unfortunately you cannot perform operations that combine ReportItems. Therefore the mathematics needs to take place at the appropriate row level using values derived from the data source and the results held in hidden fields at this level that can then be referred to using ReportItems.
So one approach would be to add a dummy outer grouping level to your report with a footer that you use to calculate these values. This footer line can be hidden and used as a source of ReportItems for your footer and possibly your header.
Also see http://www.keepitsimpleandfast.com/2011/09/running-totals-per-page-in-ssrs-to.html

ssrs 2008 R2 show/hide not working on expression

I have this problem, which I have already googled,searched on stack overflow and tried every possible solution that I could found on the internet.
I have a table like this:
When the table is initally loaded the value are not visible and have to be toggled by Filter
After I click on the value, the dataset is filtered, and the Filter group will contain only 1 Value (the one that was selected) after the report reloads.
With an expression I made the left side look orange like the following, if only 1 value in a group exists :
Now I would like to also show the value on the right, but it does not work with all expressions i tried on text box level and/or group level :
=IIF(Fields!filter.BackgroundColor = "Orange" ,false,true)
=IIF(Fields!filter.BackgroundColor <> "Orange" ,true,false)
Can someone help Please ?
After days of trying in different ways, the only working solution was to add an extra column to my dataset called "hidden". If a filter value is the only value counted (grouped by filter) then put a 0 in the hidden field ,else 1 which results in something like :
Filter Value Hidden
A B 1
A C 1
B A 0
After that, on the text field Hidden Value i used expression
=CBool(Fields!hidden.value)
This Worked Great!

SSRS - Replace the Chart

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.

Assign value to cell in column depending on name of column - matrix

I have a matrix that dynamically displays columns and rows. (dûh)
I will always have a (dynamic) column with the name 'Everyone'.
Now I am looking to color those cells green that have value > 0 AND columname 'Everyone'
I think I should be doing something with a IIF statement but how do I find the name of the column for a specific cell?
Thanks for thinking with me!
Henro
You can check if a column is in scope of a group (a column/row group) using an InScope expression - you should be able to do this on the background colour expression of the offending cell
How is the column defined? Is it using a grouping or are you adding a static column using the advanced editor? Either way you should be able to use the InScope function to check if the cell belongs to a certain column
e.g.
=iif(someColumn.Value > 0 AND InScope("ColumnGroup"), "Green", Nothing)
Give a bit more info on the groups/layout and I might be able to help a bit more