How to show % of the total to each bar in bar graph Tableau - bar-chart

I have an existing bar chart for a given metric that I'm trying to add a % label to each bar (customer x) to show the % of the total of another bar (All-Customers). I do not want it to replace the "Data Volume" label at the top of the each bar. I would prefer to show each customer's percentage of data volume compared to All-Customers in the Tooltip.
In my sample file, customer is simply a number (1 thru 7). Customer 99 represents All-Customers and is the sum of each customers Data Volume. In my Tableau sheet, I made a calculated field called "Graph Labels" which takes makes my customer labels for each bar. It adds the letter "C" to the customer #.
IF [Customer] = "99" THEN "All-customers"
ELSE "C"+STR([Customer])
END
Note: I must be able to use Graph Labels as it is in my case. See the link for the photo of my worksheet showing the bar chart.
Data Volume Bar Chart Tableau

Here's a screenshot of what I did...
A few points:
Instead of using "All Customers" as your last row, I filtered that one out (customer "99") and used the Row Grand Totals from the menu "Analysis > Totals > Show Row Grand Totals".
I kept the labels as they are, but I also added the SUM(Data Volumes) in the tooltip. Only difference is that I applied a quick table calculation by right clicking on that field and selecting "Quick Table Calculation > Percent of Total".

Related

Creating a percentage in an expression

Would like to have some text in my report like the following where the percentage is based on an expression. I would like to know how to work out the percentage.
60% of letters were sent with a first class stamp
This is an example of the figures I'm working with
First Class 300
Second Class 150
Other 50
The fields used are 'StampType' and 'RefNo'. The totals are gathered by a count on the 'RefNo'
To do this, do the following steps.
First, add a new Text Box to the report. Click inside the text box so the cursor shows inside. Right-click and choose Create Placeholder.... Enter the following expression for the Value field.
=Lookup("First Class", Fields!StampType.Value, Fields!RefNo.Value, "ReportMain") / Sum(Fields!RefNo.Value, "ReportMain")
This assumes the dataset name that is returning your data is named ReportMain. Change this if needed.
This looks up the First Class RefNo value from the dataset, and then divides that by the total of the RefNo in the dataset.
Go to the Number section of the dialog, change the Category to Percentage. Adjust the Decimal places to your liking. Click OK.
Type the text you want to follow that value after the placeholder (not in the placeholder) in the text box. Like this:
Preview the report, and you should have what you need.

SSRS chart, how to prevent horizontal axis categories displaying when value is 0

I've placed a simple bar chart into an SSRS report which is designed to display a series of Consultant Names (along the x axis), with a corresponding count of patients who are flagged as being in the category ">18 Weeks" (on the y axis), based on the following expression:
=SUM(IIF(Fields!RTTWaitGroup.Value=">18 Weeks",1,0))
The chart renders fine. However, a number of the Consultants listed in the chart have a zero count, and therefore are listed across the x axis but with no vertical bar displayed, as you'd expect.
I'd like to configure the chart so that it only displays those consultants that have a count of 1 or more patients.
I'm not overly familiar with the syntax, but I've tried using the following expression in both the Series Properties and Chart Properties 'Visibility' options, to try and suppress x axis categories that are zero, but it doesn't have any effect on the chart:
=iif(Fields!LastConsultant.Value ="",True,False)
Please can anyone advise on correct syntax and appropriate expression field to enter it?
Presumably your consultant names will be in the category group, if so right mouse click and select category group properties.Select Filters, in the expression enter count(fields!patients.value)... for example. Change type to integer , operator to greater than and the value to 0.

SSRS report total fields

How to show the total of each page in SSRS report. What I exactly mean is if pageNumber = 1 total should be sum of amount on page 1, if pageNumber = 2 total should be sum of amount of page 2 + total from page 1, etc...
.Have you tried using the running value function?
See https://msdn.microsoft.com/en-us/library/ms159136.aspx
You can also use ReportItems![CellName] to enable you to display the value in the report footer if required.
If this does not give what you require and you have a fixed page size eg A4 you can calculate the page totals and Page Numbers as a fields in your data set. This is more powerfull in settings where for example you want to print a set of customer statements in a single print run. Each customer statement would need its own page numbers and totals. Again you can use ReportItems to display these values in the relevant part of the report as they would appear at the detail level of the dataset. In this case you add a hidden field(s) containing the values you require on the detail line and pick them up using ReportItems. You can also force a page break at the end of each Page number group
To repeat the report Header / Footer on each page see this link
http://bhushan.extreme-advice.com/repeat-table-header-on-each-page-in-ssrs/.
To start with go to the footer properties and make sure repeat on first and last page is checked.

SSRS - Replace the Chart

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.

SSRS Sum in table group

I am working on SSRS reporting services.
I have a table on which I applied group. Originally I had this data:
I changed something in my tablix and created a tablix and added a parent group of Age i.e. left column and then in the right column, I applied an expression: =SUM(Fields!AgeTotal.Value, "Group1")
which made the result like this:
Now I want 3,3,3 and 2,2 not to repeat and make them 1 row of each group.
Like this:
UPDATE:
Right Click on the details cell and select add Total, then right click on the entire details rows and change it's visibility to Hide.
This should do the trick!
EDIT
Setp by step tutorial with Image:
First image example: on the left the result you want, on the right the result you get from a simple grouping.
I'm getting the sum(but you could use a count or whatever aggregation you want) of the field lam_larghezza (which, for your information, is a width) group by different lam_spessore values (which, is a thickness)
I'm sorry but mi IDE is in Italian so here a simple translation:
Aggiungi -> Add
Gruppo -> Group
Righe -> Rows
Raggruppa per -> Group By
Totale -> Total
Dividi Celle -> Split Cell
Visibilità Righe -> Row visibility
Let's start!
Create the dataset for the report and clean the report
Add a table to the report
Add the detail field in the data row
Right click on the full row
Add group -> Row group -> father group -> group by grouping field (should be age)
Click on the detail cell (only the cell not the entire row, and remember that the cell had to be highlighted not the text inside the cell, because two different contex menu appear) -> Add Total
You now have 1 grouping cell and two detail cell
split the grouping field cell
set the visibility of the detail row to hidden
And you are done!