Tableau Actuals and Budget as measures - bar-chart

I have a question about Actual vs Budget for financial information.
Right now my dataset has 6 measures; 3 actuals and 3 budget.
{A1, A2, A3, B1, B2, B3}
I want to be able to show on a bar chart {A1 B1}, {A2 B2}, {A3 B3} as a bar chart of actuals with budget as a mark on each bar.
How would I be able to show this? Tableau is treating each of the measures separately and I'm unable to combine them to show actual vs budget for my three areas

It would be simpler if you can reshape your data wth 3 columns: Area, Actual, Budget.
In that case, you could select all 3 fields in the data pane (left margin), click on the Show Me panel and select bullet chart to get your bar charts displayed against reference lines and bands.
Tableau would have to take a guess about which field to use for the bar and which for the reference line. If you want to swap the two choices easily, you can right click on the axis and swap the reference line.

The problem with your data is that it's column based rather than record based. So as Alex Blakemore suggested you need to reshape your data, which in your case can be done pretty easily within Tableau.
In the Datasource Tab choose the columns A1 to B3, right click on the header and choose "Pivot".
What you have done now is putting it in 2 columns, one with the "code" A1 to B3, the other one with the amount (plus any additional columns you had before).
You can make it a bit easier now by creating two calculated fields with LEFT([identifier],1) for the Type and RIGHT([identifier],1) for the Area. Where [identifier] is the column with the A1 to B3 values in it.
Now you have everything to display the Budget and actual side by side by dragging the [area] and [type] in the columns shelf and the [amount] in the rows shelf.
If you need to have the budget as a seperate mark on the bars, you will have to create two more calculated fields (and end up with Alex' suggested idea) where you create two columns, one for [actual] and one for [budget] by creating them with if [type] = "a" then [amount] end and if [type] = "b" then [amount] end
now you can remove the [type] and [amount] pills and add the [actual] and [budget] ones instead.
Now you can format them as you want in the marks pane.

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:

How can I add TextBoxes to an existing Matrix in an SSRS project?

Why is it that a control that appears in the property list in a BIDS project is not represented in the corresponding .rdl file?
Let me step back a bit; I'm having a heck of a time trying to figure out how to add items to an existing report, either via the XML (.rdl viewed as code) or on the design surface. I can click on a rectangle on the design surface and see a column row above it:
And if I click on the "pipe"-separated segements on that column heading row, I see "MatrixColumn4", "MatrixColumn3", "MatrixColumn2", and "MatrixColumn1" in the designer; for example, here's MatrixColumn3:
However, only one of these columns appears at a time in the Property list - if I select MatrixColumn3 on the design surface, MatrixColumn1, MatrixColumn2, and MatrixColumn4 are not there. The same holds true for selecting any of the others - it turns up temporarily in the Properties list but "hides" all the others:
Stranger yet, when I search the .rdl file (viewed as XML) for "MatrixColumn1" (or "2" or "3" or "4") they do not exist there. In fact, the only reference to "MatrixColumn" in the entire file is this:
<Matrix Name="matrix1">
<MatrixColumns>
<MatrixColumn>
<Width>1.67609in</Width>
</MatrixColumn>
</MatrixColumns>
. . .
This seems exceedingly bizarre - shouldn't there be four sets of <MatrixColumn></MatrixColumn> there?
I want to add another column heading, with a Textbox-as-label and a Textbox below that to display dynamic content, but how can I do it without adding another column heading?, or at least making room for this new column?
I can increase the width of the matrix ("matrix1") by dragging it or by increasing its Size.Width value, but its existing contents expand with it, giving me no room to add TextBoxes inside of it.
Maybe I'm approaching SSRS from a completely wrong mental angle, as I don't see much of a connection between what the report generates and what I see on the design surface and in the XML.
To add another column to a matrix right click the column header and Select Insert column. Then choose either inside group (left or right), or outside group (left or right).
A column created inside the group will repeat for every item in the column group
A column created outside the group will only appear the once to the left or right of the grouped columns.
Are you sure you are referring to a matrix (dynamic columns and rows) and not a tablix (dynamic number of rows only)?
The process for tablixes is the same as for matrixes as described above, just without the inside/outside group option.
Either method described above will include a new column with a single text box to label the column with, and another text box underneath to put the detail in.
You can also do this process by dragging a field from your dataset in the Report Data panel to the appropriate location in your existing table.
Please let me know if this helps, or if I've misunderstood your question and you require a different solution.

Report Side By Side

I've managed to create a report template and use it inside another report, as a method of replicating a "template"...
The filled template is like this:
As you can see, this is not a wide template, and i can fit 3 of it on a regular page... my problem here is that the best i could achieve so far is vertical replication!!!
What i'm looking for here is a way to say "fill all the 'columns', then, move to the following line"
Anyone ever managed to do this?
Details:
Using SSRS 2008 R2
Using BI tools for VS 2013
There are a few ideas that spring to mind.
Add three columns to the report via the Report.Columns property and have the detail fill top to bottom then left to right. (This may not be ideal as you stated you want a left to right, to bottom flow).
Duplicate any number of mailing labels samples on the internet substituting your sub-report as the detail.
Create 3 Table's with three detail data sources and have the data source return the id's for your sub report ordered in a Take(1) Skip(2) left to right, up to down fashion, basically three partitions of data ordered by some value.
Create a Table with three columns and place a sub report in each column. Have the data return in a A-B-C | D-E-F | G-H-J fashion.
Create a Table with one column and place a column group on a value that will return 1-3 for your detail records, pushing your columns out to desired column width.

SSRS 2008 - charts by groups with matrices underneath

The report user wants to have groups by business unit and within each group they want to chart a set of same 4 metrics one under another: metric1, metric2... metric4. Under each of the merticN chart they want a matrix showing metricN values in rows where the months are the columns (metricN is actually 3 metrics: current month's, YTD and previous YE which is the same for every month).
Question: I know that it is possible to use list, bound to a group, to show charts by groups. Is it possible to insert a matrix for the same group under the chart (not to the right of it)?
I tried inserting nested rectangles, but a matrix inside a nested rectangle can no longer be bound to the same dataset, needless to say to the group (dataset is disabled).
As a proof of concept I can build a matrix with a chart inside the proper group, which does not solve the task of putting charts above the data. The charts, even so small, look fine in design, but in preview mode SSRS plays some dirty tricks. The resulting chart (occupying 100% of the group box and leving no space for group title, of course) is very ugly - horrible combination of scaling (why?!) and being squeezed into a small area. It looks like SSRS is going mad when a chart is in a confined space. The charts are stretched vertically and horizontally, the lines are thick and fuzzy. Only those charts, that end up in a partial group at the end of the page, look OK from graphical POV.
The most scandalous part is that even though data is correctly groupped by the matrix and reflected in the axis auto-scaling ticks and legends, it is not plotted. The charts remain empty. There must be some 'advanced option' hidden somewhere that is necessary for the charts to work within a matrix, or it is simply bugged.
Edit:
The best I've done so far was adding a Total row above a group and inserting a chart into that cell. It is somewhat closer to the requirement with several drawbacks:
The chart is only above the group name, not above whole matrix
Due to p.1 the chart cannot be made large enough
The matrix's column headers are separated from matrix data by the area
height of the chart
However the chart is still not plotting data. Playing with Category/Series Groups 'Synchronize group in' property is not helping.
To have a chart per group and group data in a matrix one on top of another, one should create a list and insert the required row groups with header rows. Then make group columns except the innermost hidden, delete the detail row and insert both chart and matrix into the innermost child group.
Then put the group fields into the group header cells.
This way the group titles appear at the beginning, then the chart, then the matrix and the last two are repeated in every child group.

Use repeated column value as section header in tablix

I'm looking for a way to format a SharePoint report using a tablix to create a labeled series of individual lists from a single data set. (Unfortunately, searching only turned up a lot of stuff about tablix headers disappearing on subsequent pages, which is not the problem I'm working on here).
I have a query set up to return results that look something like this:
List Name, List Item
A, 1
A, 2
A, 3
B, 4
B, 5
C, 6
C, 7
I would like to find a front-end trick to display them as follows:
A
1
2
3
B
4
5
C
6
7
So, break the result set any time the value in the label column changes, and use the new value as a header for the corresponding group, formatted separately. I know I can create a tablix group that would show the repeated value in the left-hand column, but that kind of presentation isn't going to work for my client--they really want a top-labeled series of lists.
I know I could just put in a whole bunch of different tables, but doing it with a single tablix would be a lot easier (since I have about 40 sub-lists to do), and would suppress any list categories that are blank without needing an additional workaround.
Apologies in advance if I've missed anything obvious!
Just add a row group in SSRS to the tablix. In desinger go to the lower left under 'Row Groups'. By default you should have a '(Details)' or equivalent. Right Click that and choose add 'Parent Group'. Ensure you select to add a page header if you want detail of the group on a seperate row.