SSRS: Getting Value From A Particular Textbox - function

I am using Visual Studio 2012 for SSRS purposes.
Currently, in my SSRS report, I have the following setup in my tablix/matrix:
Basically, I have row groups of Date and Mailbox and my first column is Starting which is number of records when starting of a particular date.
When I initially preview the report, this is what shows up:
Right now, in my total box, I have it as sum(starting) which is wrong and doesn't make sense. I basically want the First(Sum(Starting)) but I know SSRS is currently not allowing me to do that.
And I can't do First(Starting) because when I do my drilldown, it looks like this (I blurred out particular mailboxes):
So basically if I did First(Starting), it would pull in 25, instead of 339, because that's technically the first value.
How do I write an expression for the total line in Starting where I can get the first value that shows up underneath the Starting column where it is Sum(Starting) which in this case would be 339.

Basically just had to write a different dataset to be just the value I needed then wrote an expression to grab that specific value from the dataset.

Related

SSRS Data Returned but Not Showing in Tablix

SQL Server 2019
Report is being built in Visual Studio 2019, and is not yet deployed to SSRS.
Scenario - Report calls a stored procedure passing in 3 parameters (Rep ID, Year, Month) then displays the "first row" value from several columns of the data returned in a page header section, then displays the rest of the columns' data in a tablix.
Issue - it works fine when I request for all (wildcard % feeding into a LIKE statement) Reps for any given month/year combo. It breaks when I request for a specific Rep ID.
Here's what I've found:
it passes the correct Rep ID value in the query as viewed via Profiler,
the statement grabbed from Profiler works fine in SSMS directly
the number of rows returned via SSMS direct is 347, the number of rows returned as seen in Profiler is 355 (odd (to me), but not the driving concern at the moment as there's also a rowcount diff in the "all" query that is displaying fine; assuming some sort of overhead)
the "first row" values from the returned data are showing fine on the report preview screen
it's the rest of the columns' data that is not showing up in the tablix on the report preview screen when I select a specific Rep ID vs. using All
I also tried hard-coding the values within the stored procedure, and the same number of rows are returned, with the same result of "first row" values being used but the tablix not displaying the rest of the data
I do have a "no rows" message, but we know it's seeing the rows or it couldn't get the "first row" values so that's rather moot
What sorts of things do I need to look at to get this working?
Thanks in advance!
2020-10-21 EDIT: for what it's worth, I've now also tried
recreating the report without the top-level grouping (REP) since a single-Rep version does not need that level, no change
adding to the report (so, it's seeing the exact same data) a matrix vs. a tablix, matrix displays both the all-rep and single-rep data fine, I just can't make that give me the same format, arrangement, and sub-total lines, etc. as the tablix (not surprising since they're different beasts) though I'm trying my best there in case I can't get the tablix to behave
profiler-ssms-reportpreview-image
I found the issue. It was hiding the grid on 1 Rep row instead of hiding it at 0 rows as expected.
<Visibility>
<Hidden>=RunningValue(Fields!dataRepName.Value, CountDistinct, Nothing) = 1</Hidden>
</Visibility>

SSRS Target Line

I would like to re-create a line chart in SSRS like the one below (created in excel)
Target vs Revenue
I can re-create the running value (green line - revenue) but I have no idea how to do the straight target line (grey one) that should end at the end of the current month. The value for this line comes from a text parameter (I type in the target for current month manually), so ideally this should be a running value of the parameter number divided by the number of days for this month ending on the last day.
Can I have an angled StripLine to achieve that or shall I use an expression, if so, can you help me to build it, please?
Thank you for your help.
This answer assumes you know what month you are running the report for and you can therefore determine the number of days in that month. I won;t cover that here, ask a new question if you can't do that.
To create your target line, open your dataset properties, click the 'Fields' tab and Add a new field.
Call the new field Target or whatever you want and hit the fx button next to field source. Set the field source to following expression.
=(Parameters!Target.Value/31) * DAY(Fields!myRevenueDateField.Value)
You will just need to swap out the 31 for the actual number of days in the month, and the correct date fields from your dataset.
I used some sample data in my test with a target of 3000 and got the following result.

How can I append the results of additional queries to an SSRS report?

I am generating an SSRS report whose results are displayed like so:
I need to append similar query results (same exact query, one different parameter value) to the right of this data, so that one additional result set of data (from a 2nd query) would look something like this (but with different data, of course - this is just copied-and-pasted to show what's needed):
How can I add multiple of these similar-but-distinct result sets so that they can be read from left to right as shown above?
Solution: COLUMN GROUPING
If I have understood your question correctly, you are expecting to show those 3 columns repeatedly for different set of values. All you need to do is put those 3 columns in a group (Column Group) and Group by on whatever "Field/Parameter" you want to it repeat. Let me know how it goes!!
Based on what is written here, this is how I accomplished this:
I created a new report based on the existing one, and then added a Subreport and then dragged the existing (original) report onto it (I dragged "VariancePricebyProduct_Facelift.rdl" onto the subreport in "VariancePricebyProduct_Facelift_WithSubreports.rdl"). Then I selected the context menu item "Subreport Properties" and added a parameter ("Unit"), providing it with a "hard-coded/baked-in" value ("CHOPHOUSE") different from the one to be provided by the user for the main report.
Then, since I want to keep the same date values from the existing report, I added two more parameters to the subreport and set them to use the same values for the date range as those used there in the main report by selecting the "formula" ("fx") button and 2-clicking the appropriate parameter to be used as the passed-in (tramp) value:
That works. Just to make it plainer, here is how it looks at design time:
The mess at the top is "VariancePricebyProduct_Facelift.rdl"; the bit below is a Textbox/Label for the subreport and then the subreport itself.
And here is how the data looks where the original/base report finishes and the subreport begins:

How to Display Only 1 Value Label in SSRS 2012 Calculated/Derived Series?

I have been using SSRS 2012 (Sql Server Reporting Services) with SQL Server Report Builder 3.0 (11.0.2100.60) to create Column charts that display columns for each day/week/month and display a trend line based on the mean across all days/weeks/months.
However, although the calculated series reflects only 1 value (the mean across all days/weeks/months), value labels appear on the chart displaying the single mean value for each day/week/month - that is, 3 days will result in 3 value labels for the same mean value.
Is there a way to force the series to show only 1 value for each mean trend line?
See below for sample chart.
The work-around I ultimately settled on involved creating duplicate series with value labels but invisible data points (obtained by setting Color to "No Color").
The values for this series are only assigned if the "dayofweek" field matches the first "dayofweek" field in the dataset, so only 1 data label will be displayed (namely, the first one).
For example, to show a single value for the average of the "physio" field for physiological alarms within my dataset ("techphysDayofWeek", I use the following formula):
=IIF(Fields!dayofweek.Value = First(Fields!dayofweek.Value,
"techphysDayofWeek"),Format(( Avg(Fields!physio.Value, "techphysDayofWeek") /
Parameters!StartDate.Value), "##.#"), "")
I wish SSRS provided an easier way, but after struggling with this seemingly simple issue for hours on end, I'm just glad to have any fix!
You can set the label text to be based on a formula. In that formula you could look at the value of the grouping field, and set the text to an empty string if it's not currently the group you want to have the label on.

Show a Customized Text in the Prompt List

Goal:
Display the text "All State-Province" instead of "All geographies" at the prompt list in SSRS
Problem:
I tried googling around and in the end I don't know how to solve it.
Information:
*Im using SQL server 2012
I don't use Report Server 2012, but in 2008 the following applies.
It depends on how you're populating your parameter,
If you're declaring the values in a list
Right click on the parameter, and change the label text.
or.....
If you're populating from a query then you need to ensure that the value you're using to populate the label returns "All State-Province" instead of "All geographies".
One way round this would be to set up a calculated field on the query used to populate the dataset
something like
=iif(Fields!LabelText.Value="All geographies","All State-Province",Fields!LabelText.Value)
Then use that field as the label.
I see your update..
What I believe you need to do, is set up a new calculated field on your GeographyStateProvince dataset
Call it NewLabelText.
Then use the expression
=iif(Trim(Ucase(Fields!ParameterCaptionIndented.Value))="ALL GEOGRAPHIES","All State-Province",Fields!ParameterCaptionIndented.Value)
Then as shown in my previous screen print, use the new calculated field instead of ParameterCaptionIndented
You can see your datasets on the left of this picture.