Is there a way to have a pie chart only show labels if there value is at least 1%? I have a dataset that returns about 20 results and I total the set then add a percentage to each individual return. So sometimes there will be 0% and it just junks up the graph and makes it difficult to read. Is there a standard way or custom function that can disable 0% from showing?
Let me add some knowledge here as well. My data is set-up so that the data returned from my dataset is displayed in column 1 and 2 - then in column 3 is a percentage that divides the data in column 2 by the total column. So it looks like this:
Microwave 42 30%
Stove 100 70%
Total 142 100%
How could it be achieved with data in this format?
In the past I've solved this by using a custom expression in the Series Label:
Where I essentially display an empty string where the data % is under a certain level, something like:
=IIf(Sum(Fields!MyValue.Value) / Sum(Fields!MyValue.Value, "ChartDataSet") < 0.01
, ""
, "#PERCENT{P0}")
Where Sum(Fields!MyValue.Value) / Sum(Fields!MyValue.Value, "ChartDataSet") is simply working out the % value of that particular group.
Edited to add:
Actually, thinking about this a bit more, you can use the Chart Series -> Label -> Visible property to control this; set the property as something like:
=IIf(Sum(Fields!MyValue.Value) / Sum(Fields!MyValue.Value, "ChartDataSet") < 0.01
, False
, True)
Maybe this is a slightly neater way of achieving the same thing.
Related
What I would like to get is the Gross Margin % of the Revised Budget cell (11%) and place in a text box at the top of the page so it stands out a little more.
This is my current dataset output and also what is rendered in the table.
Header
Original Budget
Change Orders
Revised Budget
Contract Value
1000
0
1000
Labor
500
500
100
Gross Margin %
10%
10%
11%
I have tried using some IIF statements but that seems to only pull from the aggregate of the dataset and have looked at the LOOKUP function but that seems to only target a row.
Something I tried that isn't working - doesn't look right anyway
=Fields!Header.Value = "Gross Margin %" and Fields!Revised_Budget.Value = "Revised Budget"
If someone could point me in the direction of the correct function that would be great.
Running SSRS 2012.
Here is the report design
The row you need the value from is a group total, then you should be able to use the ReportItems collection and add a reference to actual textbox.
In your example, click the cell that you want to repeat (the one at the bottom of your report) and find its name from the properties panel, some like TextBox99.
Then in the textbox at the top, set the expression to
=ReportItems!textBox99.Value
That should be it.
I ended up using the Lookup function. The first value is name of the value from the Header column that I was looking for. The last value is the which data I want to return and that is the Revised_Budget value from the ProjectCosts dataset.
=LOOKUP(
"Gross Margin %",
Fields!Header.Value,
Fields!Revised_Budget.Value, "ProjectCosts"
)
I have two text boxes in my SSRS report.
The Total Number is simply - =COUNT(Fields!CommunicationId.Value)
The First Call Resolutions = =SUM(Fields!FirstCallResolution.Value)
The FirstCallResolution simply has a 1 for when it is a first call resolution and a 0 when it is not.
What would the expression be to get this to show the % correctly in SSRS?
Thanks
Edit : format code
You can do calculations in your expressions. Try
=(SUM(Fields!FirstCallResolution.Value) / COUNT(Fields!CommunicationId.Value)) * 100
If you looking for a precision and a percentage representation., you can also write the below expression in the text box where you want the result to be displayed.
=(SUM(Fields!FirstCallResolution.Value) / COUNT(Fields!CommunicationId.Value))
You can then do a custom formatting for this text box in the Text-Box properties.
Right click on Text Box --> Text Box Properties --> Number-->Custom, and enter P1 or P2 or P3 and so on for number of decimal places after the decimal point.
You can also use the Round function in your expression. With this function =ROUND(...,1) you'll get one number after the decimal point. If you want two numbers after the decimal point then use 2 instead of 1, and so on.
=Round(((SUM(Fields!FirstCallResolution.Value) / COUNT(Fields!CommunicationId.Value)) * 100),1)
Try =FORMAT((SUM(Fields!FirstCallResolution.Value) / COUNT(Fields!CommunicationId.Value)),"P")
I have a question, want some assistance.
Q) My question is that i have a chart in which analyst assigned for many incidents and some analyst have 1 or two incident assigned. just because of this the bar chart looks ugly some time. So thats why i used a new chart to represent Min incident count. But i want there some creativeness, for which i want there a radio button or OnClick event ( I do not know how to use both these. When report runs by default it`ll show Max incidents count chart and when we used radio button it will show Min incidents count chart, on the same chart area no need of new area or on new page.
Kindly help me or refer me some links and with ideas. As i have searched many blogs but i didn`t get any big achievement.
Below is my Simplified query;
SELECT
Count(IncidentDimvw.Id)
,UserDimvw.FirstName AS Analyst
FROM
IncidentDimvw
FULL JOIN WorkItemDimvw
ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey
JOIN WorkItemAssignedToUserFactvw
ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
JOIN UserDimvw
ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = UserDimvw.UserDimKey
WHERE
WorkItemAssignedToUserFactvw.DeletedDate IS NULL
GROUP BY
UserDimvw.FirstName
Having (Count(IncidentDimvw.Id) = (#Count))
Having Clause is right or wrong, i donot know.
I used the following expresion in series as you suggested.
=iif(Parameters!Count.Value, Max(Sum(Fields!ID.Value)), Min(Sum(Fields!ID.Value)))
Sample data is as folows;
Regards
Muhammad Ahsan
I can think of a couple of ways to approach this:
Dynamic expressions based on parameter
Say you have a simple DataSet like:
And also a boolean parameter called showMax.
We can create a simple bar graph based on this:
The most important thing to note is that Series value is expression-based:
In the above example the expression is:
=IIf(Parameters!showMax.Value
, Max(Fields!value.Value)
, Min(Fields!value.Value))
i.e. when showMax is true, report the Max values, otherwise report the min values.
In this case I've also updated the Axis title, Chart title, and Custom legend text to be expression-based:
Axis Title: =IIf(Parameters!showMax.Value, "Max", "Min")
Chart Title: =IIf(Parameters!showMax.Value, "Max per group", "Min per group")
Custom legend text: =IIf(Parameters!showMax.Value, "Max value", "Min value")
The chart behaviour changes based on what parameter is selected as required:
Set Visibility based on parameter
Another option is simply to have to charts and hide one depending on parameter selection.
For example, for the Max chart the Hidden property can be set to:
=Not(Parameters!showMax.Value)
Setting this property correctly for each report will mean only one is ever displayed to the user, i.e. it will look dynamic.
Either of these options should work; the first keeps the layout simple in the designer makes the chart more complex, the second makes the layout more complex but keeps the charts simple.
Hopefully one option will work for you.
I want to draw a chart in linux like this:
1################# 64.85
2################### 72.84
3####################### 91.19
4####################### 91.61
5########################### 108.66
6############################ 110.69
7###################################### 149.85
8####################################### 156.60
9########################################### 169.81
I want to do that in python, of course you noticed that I don't want code like:
for i in data:
print "#"*i
because data may contain big numbers, so it is not nice to print "#" milion times.
So what is the mathematical equation that I must use to do this, I think this is a kind of mathematical problem
Thanks a lot
You have to work with percentages I think sum up all you values and then you do bar value / total of bar values
So if I have the following values 1 2 3 6 the total will be 12 so then
i will do 1 / 12 the percentage will be 8 so you print '#' 8 times and so on.
then the max # you can print is hundred.
I don't know if this is what you want, but hope this will help.
I'm new to SQL Server. how can I add the values of my Pie Chart to the Legend next to the Series fields? In this case I want the percentage.
For example:
United States 43.2%
Canada 22%
etc.
Here is the answer I use.
In the Series Proporties under Series Data you will find the Category field: (blank by default)
Enter what ever text you want and the keywords for the values you want displayed. Below are the values entered and the Legend display results.
Also Hispanic - (#VALY)
Also Hispanic - (2156)
Also Hispanic - #VALY
Also Hispanic - 2156
Also Hispanic - (#PERCENT{P1})
Also Hispanic - (21.8%)
Also Hispanic - #PERCENT{P1}
Also Hispanic - 21.8%
Maybe this will help
http://technet.microsoft.com/en-us/library/dd239373%28SQL.100%29.aspx check the section titled "To display percentage values in the legend of a pie chart "
Had the same wish. I am charting number of staff in a quarter by staff category. I have a simple proc that takes a date (#EOQDate - start of quarter) and lists the staff . So I added a simple total in my SELECT SQL statement...
, COUNT(staffID) OVER (PARTITION BY #EOQDate) AS StaffCount
then in SSRS design mode click on the category legend and on the bottom of the chart in the Drop category fields here section right-click on the category you dragged into this area and select Category group properties...
In the Lable box click the expression builder and build the expression you want to see. Obviously you need the existing category lable, in my case...
=Fields!StaffCategory.Value
Then add the percentage which is Count(Fields!staffID.Value)/Fields!StaffCount.Value
You'll need to turn it into a percentage, so my final expression looks like this...
=Fields!StaffCategory.Value & " " & Format(Count(Fields!staffID.Value)/Fields!StaffCount.Value, "0.00 %")
And Wullah! category lable and percentage.
We should be knowing the exact way of calculating the 43.2 to achieve this.
For example:
Total Number of Cycles: 20
Total Number of Cycles Used : 10
Percentage of the Cycles: 10/20 * 100 = 50 %
Now I would write the expresssion to complete this Case:
=Sum(Fields!ID.Value, "Total_Number_Of_Cycles_Used") * 100 / Sum(Fields!ID.Value, "Total_Number_Of_Cycles") & "%"
"Total_Number_Of_Cycles_Used" and "Total_Number_Of_Cycles" are the two datasets created.
For some Percentages, sometimes we would not be requiring the decimals more than 2. We could achieve it by using.
=LEFT(FORMAT(Sum(Fields!ID.Value, "Total_Number_Of_Cycles_Used") * 100 / Sum(Fields!ID.Value, "Total_Number_Of_Cycles"))) & "%"
Your Query:
="United States" & Percentage Expresssion as Mentioned Above
Hope this Helped You.
Regards
GVS
In the series label properties of Chart..set #LEGENDTEXT #PERCENT{#%;;""}
Regards,
Krishna