I have a bar chart in SSRS that does legitimately produce zero values. Is it possible in SSRS to drill down on the zero values like you can with non-zero values? The action on the data series works great for all values other than zero.
What about a range chart? The range chart takes dates as values, so depending on how your data is grouped as long as they have a date associatead with it they will map out and then you can drill through. You might even be able to add dates yourself.
The only thing you have to watch out for it that the range chart takes in a range of dates so you need two. But you can always do a dateadd aggregate function to produce another column and that could be your second date value.
Let me know if this helps, Cheers!
The zero values still have a clickable link, it's right on the axis (or at zero). Not easy to find or to click but it does work.
Related
Hopefully this is simple. I know how to choose a value in the property section for a collected threshold to group all values under a certain percentage; however, I want to know if it's possible to set 2 values. If so, how do I go about doing that?
For instance, group all values with a value of 1-3% into a pie slice and group all values with a value of 3%-10% into another pie slice with the rest of the values each getting their own pie slice.
As a caveat, while the answer below isn't hard to set up it is a bit ugly and not great for maintainability or efficiency. I'd consider working on the query end to break out the categories.
You can set up the chart as a subreport and pass it the total as a hidden parameter (as you can't directly use aggregate functions in calculated fields or grouping expressions). Then use a category grouping expression similar to the following, changing field names as appropriate:
=IIF(Fields!Value.Value/Parameters!Total.Value<0.03,"Other (<3%)",IIF(Fields!Value.Value/Parameters!Total.Value<0.10,"Other (<10%)",Fields!Name.Value))
If your dataset doesn't rely on any parameters, you could also skip the subreport and just set up an extra dataset that grabs the sum total and have an internal parameter default to that value.
I have a dataset that calculates the actual business days. I've added a bar chart with #beginningdate and #enddate parameters. When I preview the report it only brings back one bar (the first range "1-10 Days") in the report.
The report renders with all 8 bars on the chart I'm only using the #enddate parameter, but the performance on the report is horrible.
Here's my ranges for the chart:
I'm sorting the grouping with the following expression:
Notice the As of Date parameter...this takes a long time to render.
What I need is to get the bar chart (as shown above) shown the same when I have set-up the grouping when I enter a date range.
As you can see below, the report only returns one bar in the chart even though I have 2 date parameters and changed my dataset AND A.EFFECTIVEDATE BETWEEN (#ASOFDATE) AND (#ENDDATE)
How do I make this work to pull back the bars in the chart when adding a date range?
Hopefully this makes sense.
Thank you,
I figured this issue out. What you have to do is right click on the X axis. Under the Axis Options go to intervals and change it from Auto to 1. This fixed my issue and I can now run a chart with a date range.
My chart looks like this with a date range.
I am trying to dynamically format the labels on my SSRS charts based on the underlying value. I'm trying to do this in two scenarios, one to format dates as ordinals and another to choose the appropriate number of decimal places based on actual values present. However, when I use the expression editor with an expression something like this...
=IIF(MAX(ABS(Fields![axisfield].Value))<2, "0.0%","0%")
...the Fields![axisfield].Value is always returning the first value from the dataset, meaning, in this example, if the first value is less than two, the labels will be formatted with one decimal place, even if it is the only one less than two. (So the 'MAX' function is essentially irrelevant.)
That example is attempting to set the overall formatting based on the largest data point in the series, in this next one I'm trying to format each label separately to get Ordinal dates (i.e. 1st, 2nd, etc, and yes, this formula is incomplete: it doesn't need to be to illustrate the problem):
="dd"+IIF(DatePart("d", Fields!date.Value)=1,"\s\t"
,IIF(DatePart("d", Fields!date.Value)=2,"\n\d"
,IIF(DatePart("d", Fields!date.Value)=3,"\r\d"
,"\t\h")))
This will give 1st, 2st, 3st and so on, as the first row in the dataset is for the first.
So, my question is, how do I get round this and, in the first example get the true maximum, and in the second reference the actual value being formatted?
Thanks!
I've had the same issues with using custom functions for setting label visibility. (see my entry for this: How to Display Only 1 Value Label in SSRS 2012 Calculated/Derived Series? )
I believe the issue is that data and fields are bound to the underlying data series but are not bound and accessible within the label itself.
You should be able to set the formatting in the function for the series data itself (as in the 2nd example) and then just set data labels, which will use the underlying series field value. An example with your data might be something like the following, which returns the values with the format:
="dd"+IIF(DatePart("d", Fields!date.Value)=1,Format(Fields!date.Value, "\s\t")
,IIF(DatePart("d", Fields!date.Value)=2,Format(Fields!date.Value,"\n\d")
,IIF(DatePart("d", Fields!date.Value)=3,Format(Fields!date.Value, "\r\d")
,Format(Fields!date.Value,"\t\h"))))
In the first example, you can get the max value to referring to the Dataset, as opposed to the field. Your code would then be:
=IIF(ABS(MAX(Fields![axisfield].Value, "YourDatasetName"))<2, "0.0%","0%")
(I changed the order of operations for Abs and Max because you have to use an aggregate function when referring to the whole dataset. Only then can you refer to the specific value.)
My data and this SSRS chart have a ton of problems, I'll try to keep my question(s) succinct.
First, as you can see by this chart and this screenshot of my data (just showing date and April Savings), my expression/chart is not summing all of the savings within a month, which is my goal.
It appears to be picking one amount within the correct month and using it. I set up a tool tip for April so I could see what number it's pulling (since clearly the chart columns are not representing the data whatsoever - another issue).
You'll see in the SQL data screenshot that it does indeed pull $1,230 from the April 2013 Savings. How can I get this to Sum within the month AND still do a running value from the beginning of time data began to current, this often will include multiple years.
Here's my Chart Data (note that my Team Goal works perfectly, and is even charted correctly - but if anyone knows how to force that line to go from end to end on my chart, feel free to let me know.) :
To summarize, how can I sum each month's data, while still do a running value across the months AND years?
Here's my Expression for Implementable Savings:
=RunningValue(Sum(Fields!ImplementableSavings.Value), Sum, nothing)
(obviously if I can get one working, I can get both)
My Expression for ImplementedSavingsMonth:
=MonthName(Month(Fields!ImplementedSavingsDate.Value))
My Expression for ImplementedSavingsYear:
=Year(Fields!ImplementedSavingsDate.Value)
Let me know if there's anything else I can provide.
Quick sidebar question: WHY does my chart column collect one piece of data. IE: see the tool tip $1,230 for April 2013), but the chart column displays that the number is around $1.7M? And in this scenario, both of my blue and yellow columns are displaying the same number, so why does blue always appear to be a higher number? I will ask this as a 2nd question if it's inappropriate for me to ask here.
I would use this Expression for Implementable Savings:
= RunningValue ( Fields!ImplementableSavings.Value, Sum, "Chart1")
.. assuming your Chart's name is Chart1.
My dataset currently has 12 rows of data. Each representing data for a month. I would like to have variance of a column between to rows, the rows being last & last but one i.e., latest month and previous month's data.
It could have been simple if I were to work on tablix but thats not the case. I want those values for a textbox.
Any ideas on it anyone?
I hope you are using SSRS 2008R2:
R2 introduced the Lookup function that is perfect for this scenario.
=Lookup( Fields!ProductUID.Value ,Fields!ProductID.Value,Fields!Price.Value,"PriceDataSet")
The Lookup function above will evaluate the first parameter ("Fields!ProductUID.Value") in the current dataset, then look for a matching value in the field specified in the second parameter ("Fields!ProductID.Value") in the dataset specified in the fourth parameter. The value of the third parameter is then evaluated in that row of the dataset and returned.
A little convoluted, but very helpful.
In your case, you can use this in a textbox with a calculated a static number:
=Lookup(
Month(DateAdd(DateInterval.Month, -1, GetDate())),
Fields!MonthID.Value,
Fields!Name.Value,
"DataSet1")
This should calculate a number for last month, then look for a match in DataSet1.
In this example I have a tablix with Statecode and name as below
enter image description here
Suppose you want to display the name of state of CA, write an expression as -
=Lookup(
"CA" ,
Fields!StateCode.Value,
Fields!StateName.Value,
"ReportData"
)
This will return 'California' in the text box
I ran across this post while trying to solve a similar problem but with columns of double data type. Not sure why but SSRS did not want to return my first row using LOOKUP in combination with ROW_NUMBER in SQL(If someone can solve that all the better). I ended up using a SUM(IIF) instead. Hopefully, this is useful for someone else.
=Sum(IIF(Fields!RowNum.Value=1,CDBL(Fields!MyNumericColumn.Value),CDBL(0)))
Note: If SSRS complains about data types, just cast both parts of the IIF to the desired data type.