Missing bar/value on SSRS bar chart - reporting-services

I'm having trouble with a missing bar on an SSRS bar chart. I've done a bunch of searches online to try to find solutions, but nothing I've tried seems to fix it, and I'm getting frustrated.
I have the following data (this is a screenshot of the query results run directly from the dataset in SSRS):
And no matter what I do, the "Test" grade will not show up in the Chart:
Actually, the original list of Grades didn't include "Unsatisfactory", and the "Test" grade still didn't appear. I added the 4th grade to see if it would change which bar didn't appear, or to see if it was locked to a limited number of bars or something, but, as you can see, it included the new Grade, but it still leaves out "Test".
I've tried the following things, with no success:
Made sure there were NO chart or dataset filters set and the chart is not in a table or anything else that has filters (it's not filtering that Grade out by anything I can find)
Chart Axis Interval: =1
Chart Axis AllowLabelRotation = Rotate30 (in case the labels were too long or something...?)
Changed the size of the chart (in case there wasn't enough room for 4 bars)
Changed the label font size (in case the labels were too long or something...?)
Changed the name of the "Test" Grade from "Letter" (in case that was a reserved word or something), and also tried setting it to my name instead of "Test"
There's probably more that I've tried, but that's all I can remember at the moment.
Here's a screenshot of my chart settings -- the Expression is =((Fields!TotalStudentsPerGrade.Value / Fields!TotalStudentsInClass.Value) * 100) to get the percent:

Well, I don't understand why it's working now, but apparently, even though I checked that the query was returning all of those values and there were no filters anyhow, somehow something was ignoring one of the students that had that "test" score. I added the "test" score to another student to see if it would show 2 when it wouldn't show 1, and it only showed 1. Again, I tested the query and the "test" grade was showing in the dataset results, so I don't understand why the chart wouldn't have just shown it.
In any case, it's resolved, though I don't understand why it was broken in the first place.

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:

Hiding nested tables not working, showing A LOT of white space SSRS

So, I have a report in SSRS that contains 5 tables nested in each other all with 2 columns. We have working expressions for every table in "show and hide based on an expression" on textbox visibility, but instead of hiding the chosen tables it shows a lot of white space in the supposedly occupied area. We have been trying to reduce the white space but with minimal success. We hide the tables based on parameter values, example below:
Parameters!prmName.Value=false
=IIF(Parameters!prmName.Value= true, IIF(Parameters!prmText.Value=true, False, True), True)
The second one is for the second column which one also can hide if that parameter is chosen to be hidden.
The expressions look almost the same except some parameter names and so on.
There is 1 parameter for every table aka 5 which we use when hiding each of them.
We have tried using this in row visibility IIF(Trim(ReportItems!Name.Value) = "", true, false), but as we said it did not work.
We have also tried visibility on the tables' groups unsuccessfully.
--------------EDIT---------------
So each table is representing a kind of level. Like the first, and most outer table is a letter and the second outer table is an undergroup of the first table and so on:
A
01
011
0111
01110
01111
012
0121
01210
B
05
051
0511
05110
And so on...
In all tables, there is a text explaining the row and a subreport which contains some further information. The most inner table contains 2 subreports.
How the levels should look without the extra information
And this is how it looks when we try to hide the extra information
The blank space only increases when hiding chosen tables.
This is how the main report looks at the moment
The Expressions contain simple text explaining the level. The [ExprX] contains more detailed info about the level and then the subreport contains even further details.
This nesting became necessary because we only wanted to show levels once. Before that, it was repeating.
Hope this makes it clearer
Found a solution for our problem. Instead of trying to remove the white space we decided to never load the tabels data through several case with expressions in the query builder. Also noticed that such a 'difficult' query (with cases and stuff) had to be made in the "edit as text" inside the query builder.
Example below:
SELECT
CASE WHEN #prmLevel1 = 'true' THEN Table.ColumnName
ELSE NULL
END AS ColumnName
FROM Table
But with lots of more cases after each other.
Hope this can be of help to someone!
Have a great day!

How to hide a duplicate row in SSRS

I am new to using SSRS. I have looked around Stack Overflow for answers to this question but haven't found it.
I am producing a simple report but wish it to be filtered to not display the result if it is a duplicate set of results.
Basic report
A lot of forum posts mentioned using code similar to the following to be set in the visibility of the Table Properties.
=IIf(Previous(Fields!Country.Value) = Fields!Country.Value, True, False)
However this didn't work. I then tried going to the properties box of the country to hide duplicates and this kind of worked. It removed duplicates if they were only in the next row and unfortunately it just made the cell blank.
Attempt at hiding the duplicate rows
What I wanted is to just display the list of unique values where the reference and the country are never repeated. This way I will get a list of countries for my reference.
Many thanks in advance to anyone who is able to help a new learner like myself.
I am adding in the edit suggested by Alejandro below,
It sort of works, the suggestion did remove the blank rows (which became blank when I applied the HideDuplicates from the properties of the country. The trouble is the report is only hiding duplicates if they come from the previous line. I tried grouping etc but it did not work.
Try selecting and setting the hidden property to the whole row.
UPDATE:
Using the expression works only if the Country column is sorted, so repeated countries will be in contiguous rows.
Go to tablix property and add a sort by Country property. Don't use HideDuplicates property but use =IIf(Fields!Country.Value = Previous(Fields!Country.Value), True, False) expression in the whole row.
It should work.
Let me know if you need further help.
It sounds like you just need to group the dataset, no?
If you open the row group properties, set it to group on Reference and Country.
Here are two tables... the first has no grouping and so there are repeats. The second is grouping by Reference and Country.

Access UI chart text legend sorted as number

I have searched for a solution but I can't find one suitable on this problem.
I have a chart in access where the Y-axis is text but starts with a number, so up along the y-axis i get this:
I know why, but I don't know how to fix it.
They all have an ID which is fine. I can chose to put the ID on the Y-axis, but then the kW range can't be visualized.
How is this changed?
Changing the text to number is not possible as it needs to be like "a-b kW".
Thanks in advance.
For those who might get this problem, I found out why.
When selecting the data, it chose to use the "Total" function, and "Avg" because that is what the values are. (The picture below says "Group By" but it was automaticly set to "Avg". I just forgot to change it when i snipped for stack.
That results in:
But if i remove the "Total" function i get this:
So, removing the "Total" function works here...
In your query, can you sort by ID, but not display it (e.g., in the query designer, sort 'descending/ascending' on the ID field, but clear the 'display' check box)?
As an aside, I've always had a tough time with Access charts... on my last project, the customer wanted a rather complex bar chart, and I ended-up drawing and resizing rectangle objects to get the look that the customer wanted.

Show 0 value in bar or column chart

In this screen shot from an SSRS report with bar charts, I would like for 0 values to display a tiny bit of color rather than just being blank. Here's what it looks like now:
Most of these charts have many series. I am generating a copy of the charts for each person under review and including the comparison values for everyone else in the group. I am thus coloring the bar representing the person under review differently from the normal color so they can easily see their performance compared to others.
Now, while there are y-axis labels, I would also like the 0 value to have at least a tiny sliver of color so everything is symmetric and the color can be seen. (I am also thinking about putting those with no data at all in the chart and need a way to distinguish those, so any ideas on how to accomplish that would help as well.)
I thought about making the axis start at -1 so the space from -1 to 0 would be colored, but I can't figure out how to get the labels to start at 0 (as shown) when I do this. I have played with quite a few settings and nothing is coming out right...
Sigh. I just figured it out.
Select the X axis.
Set CrossAt and Minimum properties to -1.
Set the IntervalOffset property to 1.
Important note: the chart in Design mode will NOT show correctly. Since I put an Interval of 20, it is showing -1 19 39 59 79 99, but when I actually Preview the report, the result is correct. Don't let yourself be thrown off by the design-mode pre-preview.
Now it looks like this:
If you leave out the CrossAt property, then the bars float away from the y-axis, leaving a gap. You must use all the properties I mentioned above to make the color reach past 0 all the way to the axis line.