Third Axis in SSRS - reporting-services

I have a graph with the following axis:
This graph works fine, but I need one more addition to it.
My question is this:
I need to get a third line on there with the total amount of units for each month. I have a field that I can pull that has this total by month, but how do I go about putting it on my graph? When I try to add it, it wants to do it by manufacturer, which is not what I want. I just need a single line that has this total amount of units. Do I need to add it to the axis under manufacturer or up top next to the market percent axis?

It's a tad bit complicated, but this is what I would do:
Union the Total Units values to the Manufacturer % values and put it on a Secondary Axis. The data set would look something like this:
Chart Category = RecordDate
Chart Series = SeriesID (Group/Sort By) and SeriesLabel for the Label
Chart Value 1
Primary Axis
Expression: =iif(Fields!SeriesID <> 3,Fields!Value.Value,nothing)
Chart Value 2
Secondary Axis
Expression: =iif(Fields!SeriesID = 3,Fields!Value.Value,nothing)
Hide Legend for this Axis
Set the Line Color for each Chart Value to be conditioned on the SeriesID so the "Total Units" Marker Color in the Primary Axis Legend matches the Line Color on the Secondary Axis. Something like this: =switch(Fields!SeriesID.Value=1,"Red",Fields!SeriesID.Value=2,"Blue",Fields!SeriesID.Value=3,"Green")
Here is what we end up with:

Related

SSRS range bar chart, different color when no data

I am looking to change the color in the "gaps" in the range chart that I have built.
Essentially I am trying to build a visualization for the staff to see the availability on bays. The red markings mean the bay is booked, I wanted green then to be in between the red to highlight free bays.
Occupied bays:
I suspect I need to go back to my dataset and add in some date tables to show "null data" to allow a "switch" to work, but I thought someone might know if I could change this without going this way.
An example of the dataset would be:
Following up
here is a screen shot of my output, i added data labels to see if i was going wrong...HOWEVER I also added shadows to my data and my data is actually still there, just hiding behing my secondary bars......
you are right about my data set, i had to add a series grouping to get my appointments all to appear other wise i was just getting the first appointments on the row only to appear....
Following up 2
A further follow up, I have followed #iamdave 's excellent RangeChart.RDL
I have applied my dataset to it but I am now getting the following output, I know I am probably missing something simple, my gut is telling me the cust_id are seperating all the appointments on to seperate lines yet I have both the primary and secondary axis set to "DrawSideBySide = False"
Here is my set up..
here is my latest output, if I could just group all the rows/bars/lines down to the 6 bays it would be great.
You can do this by adding in another data series based on your original dataset, that will require significantly less processing than filling in all your empty periods as suggested by WEI_DBA.
In your dataset, add a new column that returns dense_rank() over (order by BAY) as BayID (order by should be your desired axis label).
This may be best done as a wrapping select statement to preserve the rest of the query logic as is.
In your Range Chart, add in another Values item, with the same Category Field as your current one.
Set the Top Value to 1 and your Bottom Value to 0.
You could also set this to the min and max time of your dataset or the start and end period of your report to only cover the period the Bay was available.
Set it to display on the Secondary Axis for both Vertical and Horizontal axes.
Also select the Do not show this series in a legend option.
Set up the Secondary Vertical Axis in exactly the same way as your Primary Vertical axis.
Set the Secondary Horizontal Axis Minimum and Maximum to the same values as your Bottom and Top above.
Hide both the Secondary Axes.
Select the new Values item and in the Properties window, expand the CustomAttributes section and change DrawSideBySide to False.
If necessary, adjust the order of the Values items in your Chart Data window to make sure the new Range Bar displays underneath your actual data.
Select the original Values item and in the properties sidebar navigate to Data > DataPoint:
Change AxisLabel to =Fields!BAY.Value (Your axis label).
Change Values > X to =Fields!BayID.Value (Value from point 1.).
You should now have a range chart that that displays your data on top of a solid bar, that you can set to any colour you require:

SSRS colour expression for upward downward trend line chart

I need to make a line chart with the month on horizontal axis and a value on the vertical axis.
I need to colour the line's segments in green if the trend based on the previous month is growing, or in red if the trend is decreasing.
I can't find a way to compare the values grouped by month, and I prefer not to perform this by adding another query from db.
Right-click on the Chart Series (the line of the graph) and select Series Properties..., click Fill on the left then click the fx button to enter and expression for the fill. Let's say your field is called Sales. Use the following expression for the Fill:
=IIF(Fields!Sales.Value >= Previous(Fields!Sales.Value), "Green", "Red")
This worked on my simple test. You may need to aggregate within your query (group by month and sum) for this to work properly.

SSRS - Major/minor gridlines spacing

I have an SSRS report with a bar chart with multiple series by CountryName Category group. What I want to do is have gridlines which split each country like below:
However in SSRS the major gridlines seem to interval with the line in the middle of the country name when the grid interval is set to 1 like below:
Can someone point me in the right direction into how to rectify this?
Also is there a way of adding the X axis in SSRS to start from zero like I have in my first graph?
Thanks
You can do it, there is an offset property on the grid lines (horizontal and vertical are separate). Click one one of the gridlines and look in the properties pane. Change the offset to 0.5.
Gives you this.
I'm not sure what you meant about starting from zero on the X-Axis, you have negative values so you'll start from a negative number. If you meant you wantde zero aligned to the middle. You can do that to. You need to set the min and max values of the horizontal axis to the following
Min Value:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")*-1
Max Value will be:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")
Basically we take the ABSolute largest value and use that as the extent (*-1 for the min value). The problem is that zero might not show so you'll have to play around with the Axis properties maybe to get that working. I'm sure it's possible but I don't have time to test at the moment.
My test data is not great as the number are large

SSRS Chart. How to plot line to decrease totals by date

I have a chart in SSRS that has dollar totals by date. I would like a line chart that starts with the total dollars and then decreases the total by date until it gets to zero. How can I do that?
Create a Line Chart
In "Chart Data" add the following expression to the "Values" part (with the green plus sign): "=RunningValue(Fields!colVal.Value,Sum,"DataSet1")" where colVal is the field that you want to sum up, and "DataSet1" is the scope
Then right click on the horizontal axis -> Properties -> Side Margin Disabled + Scale Options = Reverse Direction
Hope this helps!

SSRS chart does not show y-axis data labels when values are very small (<1)

I have chart that plots values of Y-axis less than 1 (0.1, 0.24, etc).
When the chart is built, Y-axis label just shows 0 at the origin and no other values along the axis.
My solution was a little ugly. Data series labels show up with the correct % signs, but the % signs do not show up on the Y axis.
Y axis: set Y axis range from 1-100 (or 1-120 so there is room to display the data labels that say 100%) Make sure you set your tick marks to Auto or a number between 1 and 100, otherwise you'll get one long bar of tick marks running all the way up the y axis.
Data series: on the series tab, change your Value Field formula to multiply your data series by 100.
Data series labels: on the series data label properties window > general tab, copy the formula from your data series Value Field into the Label Data value field. round it to 0 decimal points and add &"%" to the end to concatenate a percent to the end of it.
That way the right numbers display for my data series and my Y axis, but the % just doesn't show up on the Y axis. not perfect yet. and too much work.
I just tested this and it seems this happens in SSRS 2005 and not 2008. You can fix this by right clicking on your chart and going to properties. It should bring up the full Chart Properties, go to the Y Axis tab and set Major Gridlines at a value like .25/.5 or whatever you want.