I have a report that shows financial data by year along with a few other bits of static data:
every time I try to put in a Column group, it does either above or below the static data:
FiscalYear
StaticData1 | StaticData2 | StaticData3 | StaticData4
Or:
StaticData1 | StaticData2 | StaticData3 | StaticData4
FiscalYear
What I want is that I get the static data and then the dynamic data (which may be 1 or 20 additional columns) right beside it with the corresponding data below
How do I get the report to look something like:
StaticData1 | StaticData2 | StaticData3 | StaticData4 | FiscalYear | FiscalYear+1 ...
Thanks much!
See Dynamic Grouping to learn how to make your matrix groupings dynamic based on report parameters.
Wait a second. I think that doesn't answer your question.
It sounds like you're asking how to make more columns appear to the right of your static data at the same level of grouping. The only thing I can recommend is to modify your recordset to return a row for each final matrix cell. This usually involves a partial unpivot.
You have something like:
Row1 Static1 Static2 Year
Row1 Static1 Static2 Year
instead, you need this:
Row1 'Static1' Static1Value
Row1 'Static2' Static1Value
Row1 'Year' YearValue
Row2 'Static1' Static1Value
Row2 'Static2 Static2Value
Row2 'Year' YearValue
I hope that makes sense. I don't have a lot of time to go into much detail.
One other thing that might help you is to experiment with dropping a Rectangle into one of the matrix detail cells. Once you have that, you can drop as many text boxes into the Rectangle as you want and position them as desired. This is one of the ways to get extra values to show even though you only want one grouping level.
Related
I have a matrix that creates 3 columns when it's run and I am unable to add a title to those dynamically created columns, as required by the client, and can't find any fixes or examples online. I hoped putting the matrix and textboxes into a table might work, but the same result as the images below occurs.
Is this seemingly simple thing just not possible, or is there a workaround I'm missing?
Design View
Result Textbox displayed after columns
Row and Column Groups visible
If you have 3 MTLH1 value for each NTLH2 value then you can do something like this...
(as you supplied no sample data I generated some from the sample WideWorldImporters database). My Query gives me 5 columns and results similar to the below.
CustomerCategoryName Qtr Mnth MnthName OrderValue
Computer Store 1 1 Jan 10
Computer Store 1 2 Feb 12
Computer Store 1 3 Mar 15
Computer Store 2 4 Apr 20
Corporate 1 1 Jan 11
....
Basically we end up with 3 months per quarter
I then added a matrix control to the report, dragged CustomerCategoryName to the rows, Mnth to the Columns , Qtr above Mnth so it becomes a parent column and finally OrderValue to the data "cell".
I actually swapped the Mnth field out for MnthName in the column header to make it easier to read, but the column order is still sorted by Mnth (the numeric version). I then centered the column headers for readability.
The final design looks like this
If we run the report, the result looks like this..
As you can see we have 4 groups, one for each quarter, each with 3 columns.
If you want to customise the quarter names, you could do that if required by changing the expression in the cell. For example if we wanted all quarters to have "Q" preceeding the number except the 2nd Quarter whcih we want to have a specific string then you could use something like.
=IIF(
Fields!Qtr.Value = 2,
"Second Quarter",
"Q" + Cstr(Fields!Qtr.Value)
)
The final output now looks like this...
Alternatively, you could generate all the column headers in t-sql so where I have MnthName you could create a Quartername or similar.
Hopefully this is useful. If not, please post sample data and expected results of that sample data and I'll revise the answer.
My apologies but I am a bit lost in the world of Microsoft Access. So I currently have a query that returns a column of values. The output looks like this:
SMABranchCode
Code1
Code2
Code3
etc.
This query then gets moved to a form text box. To do this, I have used Control Source like so:
=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY"))," ","X")
This works "Ok"; however there are going to be probably 30+ more text boxes going horizontally next to this one all running the same query. Above them is a label with the Code. So basically when it spits out the data it looks like this (as long as there is an entry for that code):
Code 1 | Code 2 | Code 3
X | X | X
The problem is, I either need to go and create a query for each of these text boxes so that it only pulls a single entry for each Code OR I can hopefully change up my Control Source entry (=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY"))," ","X")) to include criteria so that each text box has its own Criteria, so that from the one original query, each Code (1,2,3) only displays its information.
I have tried changing DLookUp to have criteria which has looked like this:
=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY","SMABranchCode = Code1"))," ","X")
However that gives me an #Error! in the boxes I apply it too. I'm hoping maybe someone can help me figure out a solution since my brain is turning to mush over this.
Thank you
I presume SMABranchCode is a text type field. Criteria values for text fields must be delimited with apostrophes, date/time field values would use #.
"SMABranchCode = 'Code1'"
I am attempting to create a graph to visualize a kind of facility-utilization stat.
My query returns rows like so:
|StartDate |ProjectNumber |Facility-ID |Hours |EndDate |
|2016-01-01 00:00:00 |Project-A |Fac-A |4 |2016-01-01 04:00:00|
|2016-01-01 04:00:00 |Project-B |Fac-A |3 |2016-01-01 07:00:00|
|2016-01-02 00:00:00 |Project-C |Fac-B |2 |2016-01-02 02:00:00|
|2016-01-02 02:00:00 |Project-B |Fac-A |8 |2016-01-02 10:00:00|
|2016-01-03 00:00:00 |Project-B |Fac-A |8 |2016-01-03 08:00:00|
|2016-01-04 00:00:00 |Project-B |Fac-A |8 |2016-01-04 08:00:00|
I followed the tutorial here:
http://pnarayanaswamy.blogspot.dk/2010/09/range-bar-chart-gantt-chart-using-ssrs.html
To set up a Gantt-chart to visualize Hours, per day, per facility (Facilities on Y-axis, days/dates on X-axis, and the bar-colour to represent which project the hours belong to.)
The idea is to provide a visual idea of how many hours of the day a given facility is in use (coverage, out of 24 hours), and by which project.
I have almost achieved this, however, my chart will group together any rows with the same facility/project/hours, meaning that if I the same project registers the same amount of hours on the same facility on two consecutive days, the chart will only show the hours for the first of the two dates.
My chart-grouping looks like this (QTY is Hours)
I have attempted to add startdate to the series-grouping to help distinguish between the rows and prevent it from grouping, however, this makes the chart create a group for every unique combination of date/projectnumber/facility, which is not desired.
How do I make the chart group according to hours per facility per day, distinguished by project? I feel that I might have to add a column to my query to help this matter, but I'm not sure which.
EDIT:
Forgot to mention that I work with datetimes to draw the ranges in the chart. These are calculated in my query into startdate/enddate
The closest I can get is to use the details of the work completed in your Category Groups. This is available by deleting all groupings and then clicking on the green + icon:
Once you have done this, you can specify what you want to display on the vertical axis by clicking on the Series Properties for your Range and filling in the Category Field:
The result isn't ideal, but after a bit of work on the presentation it could be serviceable:
Are you looking for something like this? click 1 to see example chart
If so, try separating your day and time. Get start and end time and also Day (shown in example as Dte).
Then set it up like this: click 2 to see example set up
I've managed to come up with a solution to the problem that I am somewhat satisfied with.
By adding the startDate-field (any date field) to the series groups, the chart will properly display and group the hours for each date; however, this creates duplicate entries in the legend for each unique date that a project has hours registered.
It does solve the grouping-issue in the chart, which was the main concern.
As hinted by IamDave in his comment, the (seemingly) only way of properly making the color of the chart-bars reflect the project it stems from, was to use the fill-color property of the series.
To achieve this, I added a step in my query, which assigns each unique project in the result-set an incrementing number from 1 and up; which in the report is used in the fill-color expression for the series Example
The values are static, but goes up to 60. I do not expect to visualize more than 20 projects at once with this report.
This however, still leaves the legend, which will contain duplicates, if a project has posts on more than one date, but I am content with the result as it is.
I feel like I'm missing something very obvious, but searching hasn't given me a solution and I hope someone can help.
I am working on a simple chart. X axis is the date (day), Y axis is a simple number (1 to 100).
I have totals, for 3 different sites, per day. I need a line for each site on the chart.
Day | Site | Value
---------+--------+-------
Monday | site X | 30
Monday | site Y | 45
Monday | site Z | 20
Tuesday | site X | 35
Tuesday | site Y | 26
Tuesday | site Z | 12
and so on..
There is only 1 total value per day, per site.
I am trying to create 3 lines on the chart, one for each site but I can't figure out how to filter on the series level. (I'm working on a very large date range, so lines work better visually rather than doing a series group of bar charts, or even stacked bar charts)
I originally tried the multiple dataset work around (using an expression and something like
sum(field!total.value, "site X")
but that didn't work (it showed only a straight line, the first value I think) . Now, I have one dataset, but I can't find a way to filter series so they only show for one site.
I also tried this IIF
=iif(Fields!site.Value = "site X", fields!total.value,0)
but that gives a weird looking line.
I can't believe this is not possible in a chart in SSRS, I mean, it's pretty basic, so I must be missing something.
Thank you for your help.
You need to set up a chart as follows
The Values are the actual numbers you are attempting to chart
The Category groups as set up here are the individual dates.
The Series Groups are your Sites
At this point I then set the Horizontal Axis to be in Scalar/Dates format so the designer looks as follows
When you run this report using an adaptation of the (brief) dataset example above you get the following
Is it possible to show data from database in SSRS footer?
I tried but the only option present is to show first record from dataset. But I want to show all records (I just need to show one column) one by one on each page.
Is it possible?
Based on your comment I believe this link Display on Page Footer is what you are looking for.
I tried this and it works on Page Footer.
One way to do this is by making your report a list of subreports.
Make a new report with a List item and a dataset that gets a set of all the departments you are going to get. Consider this to be your "List" report.
Populate the list with the dataset. Put a page break between List item members.
Make another report (or modify your existing one so) that is designed to be a single-page report about a single department, so #department will be one of the parameters. It contains all the data you want on each page of your report, including the footer with the Department name, which it gets from the department parameter, so it doesn't need to get it from a dataset. Consider this your "Base" report.
Going back to your List report, put a sub-report in your List item, point the sub-report to your Base report, and populate the department parameter with the value from the dataset that is populating the List.
Yes, it is possible using the "Lookup" aggregate function.
Assume, your report has a dataset named "Department_DataSet" which contains all the department's data plus one additional column e.g. PageNum, that contains an integer sequence starting from 1, giving you, basically, a sequence of the report page numbers:
PageNum | DepartmentName | Address | etc.
--------+------------------+------------+-----
1 | Department 1 | ... | ...
2 | Department 2 | ... | ...
...
N | Department N | ... | ...
Now, add a Textbox into the footer and assign the following expression to it:
=Lookup(Globals!PageNumber, Fields!PageNum.Value, Fields!DepartmentName.Value, "Department_DataSet")
and it will show the department name as required, but please ensure that the page numbers go in the same order as the departments in your detail report.