SSRS filtering a series (not a group) or using multiple datasets - reporting-services

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

Related

How can I add titles to columns in a matrix that are created dynamically in a report?

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.

SSRS - How do I achieve bars coloured according to projects in a Gantt-chart?

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.

Report Builder Column Chart

Could please help me how to go about a Column(Vertical) Chart doing the following:
x-axis = Count of orders.
y-axis = Months
series = OrderType.
So basically I see the following info on the chart:
Jan 2000 I see OrderType (i) has 3 Orders, (m) has 9 orders, (l) has 6.
So this I can probably figure out, the difficult part I want to know which I have no Idea how to do is:
I want a dropdown to change the y-axis view.
The dropdown would contain : Week, Month, Year, Day.
When selecting "Week" for example, the y-axis should render,calculate and display the y-axis according to week
Much like a calendar works. I am not even sure if this is possible?
I do not think this is possible. I would suggest that you have two overviews instead, one for the yearly view and one for the monthly-year break down.
FYI, I think X- axis should be the Month/Year. And Y axis should be the amounts and series can be the order types.

Add Datetime rows to a datatable in the DataTableBuilder for Google Scripts

I've built an intraday macroeconomic forecast system in R. It uses intraday market data to update an forecast. Basically, I have a forecast series that looks like financial market data.
I want to show these data using a Google Chart in the Google App Script platform. To keep the datatable small (and thus load time down), I only want to plot intraday values for the five most recent days. For older days, I want to save only the last forecast of the day. That is, I want to have a time series plot with two frequencies of data which the user can choose from.
Here's and example of how I write the data from R (columns separated with "|"):
OBSlatest.forecast|freq
2014-03-10 14:45:00 EDT|4.09662|D
2014-03-11 15:00:00 EDT|4.10075|D
2014-03-12 14:57:00 EDT|4.08862|D
2014-03-13 14:57:00 EDT|3.998|D
2014-03-14 15:00:00 EDT|3.9843|D
2014-03-10 09:30:00 EDT|4.13823|I
2014-03-10 09:33:00 EDT|4.13468|I
2014-03-10 09:36:00 EDT|4.14078|I
I'm currently translating this table into Google App Script with
var data = Charts.newDataTable()
// Set data table columns
.addColumn(Charts.ColumnType.DATE, "Time")
.addColumn(Charts.ColumnType.NUMBER, "Forecast")
.addColumn(Charts.ColumnType.STRING, "Frequency")
// Fill in rows
.addRow([new Date(2014,3,13,14,57, 0),3.998 ,'D'])
.addRow([new Date(2014,3,10,9,30, 0),4.13823 ,'I'])
// More rows, but they all look like this, either a 'D' or 'I' at end
I've got a rough script up now that uses a category filter so that the user can choose to show either the daily frequency 'D' or intraday frequency data. However, I seem to be using the Date() function wrong. My data are all out of order and the dates don't match what I've loaded. My understanding the of Date() function's arguments is: Date(year, month,day,hour,min,sec), yet I only seem to be able to get the year to show up right in my chart. For example, the first row I'm adding in my code above yields "13 apr 2014 11:57:00" when my expectation is that it'd give "13 mar 2014 13:30:00"!
Nearest I can tell is that it is subtracting three hours from my time and one month from my month. Any ideas what's going on? This approach works fine for an HTML implementation of Google Charts, which I have up at: EfficientForecast.com
Thanks for any help!
The month parameter is zero-based, so subtracting one is the correct/expected thing to do. Check the MDN docs.
About your hour issue, I can not reproduce it. So I imagine it is something specific to your system. Please check what your Google Drive timezone setting is, then this Apps Script's setting and lastly your OS timezone setting. I imagine this is happening because some of these configurations are not matching.

Making Dynamic and Static columns play nicely in Matrix in SSRS 2005

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.