Create multipe charts using filtered data from a table - reportbuilder3.0

I'm developing a report on Report Builder 3.0 that should look like following image.
Each pie chart should receive the value of the properties "Approved" and "Reproved" for a specific date and machine.
Is it possible to filter these properties on each Date/Machine group? The DataSet may include other properties that will be shown on the Property/Value table, but will not be included on the chart
At this moment I have the following model for the report
I´ve tryed to use the lookup function, but, as expected, it returns all the values on the DataSet. Is it possible to narrow the search scope?
Below is the DataSet that I'm using for the test:
|Machine|Machine_ID|Date|Property|Value|
|--------|---|----------------------|--------|---|
|Machine5|A|2017-02-12 20:00:00.000|Total|200|
|Machine5|A|2017-02-12 20:00:00.000|Approved|150|
|Machine5|A|2017-02-12 20:00:00.000|Reproved|50|
|Machine2|B|2017-02-12 20:00:00.000|Total|0|
|Machine2|B|2017-02-12 20:00:00.000|Approved|0|
|Machine2|B|2017-02-12 20:00:00.000|Reproved|0|
|Machine1|C|2017-02-12 20:00:00.000|Total|100|
|Machine1|C|2017-02-12 20:00:00.000|Approved|80|
|Machine1|C|2017-02-12 20:00:00.000|Reproved|20|
|Machine1|C|2017-02-13 20:00:00.000|Total|300|
|Machine1|C|2017-02-13 20:00:00.000|Approved|200|
|Machine1|C|2017-02-13 20:00:00.000|Reproved|100|
Thank you.

This should be doable with row groups in a list.
Insert a list
Add a parent row group to group on DATE.
Group your details region on MachineID
Insert a tablix into the detail region rectangle
Insert a graph next to it
Insert a column next to the detail region (to the left) to get the MachineID column
It should look like this..
This shows the two row groups, and the detail region with the tablix and the graph.

Related

SSRS Static fields in groups

Good afternoon!
I have created a report with the wizard to create a matrix that is grouped and has drill down rows. I have added filters to the rows and columns and it works great! I then copied that matrix and modified the filters, so I had two matrixes.
But what I really wanted was those two rows in the same matrix, just in different row groups. So I added another group, using the adjacent below option, and then added all the child groupings. However, when I run the report it shows the values for the first row of the drill down data.
When I look at the groupings I can see the one I did manually has a 'Static' field in each row grouping but the ones that the wizard did (with the red ?), they don't have that "extra" row:
What do I need to change or how do I need to add my groups so that I don't get that "static" row and not show the data? I have the visibility set to 'Hidden' and the toggle set up for the prior grouping set data.
Assuming a few things....
the data comes from a single dataset
You are differentiating between Property and Violent crimes by filtering on a column, I'll call it IncidentGroup for the sake of illustration..
I've understood your question ! :)
Get to the point where you had just a single tablix filtered to show 'Property crime'.
Now remove or edit that filter so it shows all the data you need in the report.
Finally, right click on your Matrix1_IncidentCategory row and add a parent group, choose IncidentGroup (or whatever the column is actually called) and check the box to add a group header.
That should be it, there is no need for a second tablix.
Without knowing how you are filtering currently it's hard to give a complete answer but this should get you close, if not all the way there.
If this doesn't work for whatever reason, please post sample data from your dataset output and your current filters.

Can I use a list to repeat two tablixes on a report page?

See image below. Warehouse and Customer are dropdown lists populated via query. Year is a text field. The two tables display data from datasets driven by the report parameters. Is there a way to repeat the two tables based on each member of the Customer dropdown? Preferbly with a pagebreak after the 2nd table.
I normally do this using subreports. You could either create a single subreport that contains both tables or individual subreports. The individual approach might help with page breaks etc so that's the way I'd go.
Step 1: Create a report for your first table.
As you don't state what each table does, I'll make some up for the sake of illustration.
The key is to create a subreport that displays just the info you need in a single table. So in your case this might mean we only need to pass in a single parameter, CustomerID. You might need to pass in more such as Warehouse but I don't know...
In my made up scenario, let's assume the report shows customer contacts so we create a subreport (let's call it subCustomerConacts). It has a single parameter pCustomerID and a single dataset dsCustomerContacts. The query might looks something like SELECT * FROM CustomerContacts WHERE CustomerID = #pCustomerID. Add whatever tables/textbox etc you need to display your data.
Test this subreport works by manually typing in a CustomerID
Step 2: Create a report for your second table.
Do exactly the same again, creating a new subreport. Let call this subCustomerOrders. Repeat as above until you end up with another report that can display order details (or whatever you need).
Finally, create you main report.
This is basically what you have described in you question in terms of parameters etc.
Now to add this bit that will call you subreports.
Create a dataset (let's call it dsCustomerLoop) that contains each customer from your parameter something like SELECT DISTINCT CustomerID FROM myCustomers WHERE CustomerID IN (#myCustomerParameter)
Add a table to your report, 1 column wide and stretch it so it's wide enough to accommodate you subreports.
Set the dataset to point to dsCustomerLoop
Right-Click the cell in the detail row and do "Insert Row -> Inside Group - Below". You should not have two detail rows.
Next, right click the top detail row and do "Insert -> Subreport"
Right-Click the newly inserted subreport control and choose "properties".
Choose your first SubReport form the drop-down list
Click parameters on the left,
Click "Add" and select the CusomterID parmeter, set it's value to the CustomerID field.
Repeat this process on the seconds row, choosing your seconds subreport.
You may want to also add a 3rd row to the table, you could insert a rectangle into this with page breaks set to force a new page after each seconds subreport.
That's It. When the report runs it will produce two rows per customer, each row containing a subreport.
I hope this is clear enough, I've rushed through it a bit but if anything is unclear, let me know and I'll provide a clearer solution.

Can I combine datasets in Report Builder 3.0?

I have 3 different datasets. Each pulls from the same datasource, but each has different filters in order to pull data as of a different points in time (12/31/15, 12/31/14, and 12/31/13). Each dataset contains the fields: enum, gender, and YearEnd (YearEnd I created using an expression). Can I combine the data from all 3 datasets into one table or matrix. My ultimate goal is to create a chart to show trends over time, but I can't figure out how to combine the data. Since I have different filters for each, I believe I have to have 3 datasets. I just can't figure out how to append them all into one. Thoughts?
I believe your best bet would be one combined dataset instead of three. Create a dataset that gets you the data for all three dates.
You can filter for the rows you want (date in ('12/31/15', '12/31/14', '12/31/15')) in either your SQL query/stored procedure or in your dataset options (right click dataset, properties, filters).
You can also filter at the table level (right click the outside border of the table, tablix properties).
You can break up your table to show different dates using column and row groups, as defined with group expressions, and use expressions as well to display custom headers (2015, 2014, 2013)
I haven't done much with charts in Report Builder, but from looking at it it looks like you can use filters and groups much the same way.

Tableau create a table matrix?

I have a CSV file that looks like this. It is in matrix form where cell A1 is empty. I want to visualize this in Tableau like this
a1,a2,a3
a1,1,0.2,0.3
a2,0.3,1,0.5
a3,0.6,0.7,1
How can I build this in tableau to show a matrix?
I tried putting measure name in both the row and column field and measure values in the marks text box but i ended up with diagonal values which isn't what i want.
First structure your data in the form of a table.
A well structured CSV file for Tableau (and most tools) has a single header row that labels each column (so skipping the first cell in the header row is a problem). Then each data row that follows contains only values in each field separated by columns (so there should be no leading row labels)
Order is not significant in a relational table. The rows in a table form a set, not a matrix.
So your CSV should look something closer to
field_name_1,field_name_2,field_name_3
1,0.2,0.3
0.3,1,0.5
0.6,0.7,1
Normally, the prime use of Tableau is display an aggregated summary of the data, not to display each individual data row. So you can put measure_names on columns and measure_values on the text or label shelf to get a summary of each measure (by default a sum)
If all you want to do is to view the underlying data rows in a table for diagnostics, the easiest way is to use the view data button or menu command.
If you want to build a visualization that displays all the data (without summarizing it) in a table, you have two ways to go. The simplest is if you have a unique primary key in your data, you can place it on the row shelf to get a row in your viz for each row in your data.
If your data rows do not have a primary key, you can turn off aggregate measures from the Analysis menu, but then you'll see multiple values in each table cell. Then to get a row in your viz for each row in your data, put the calculation index() on the rows shelf and change it to discrete.

SSRS Tablix Cell Calculation based on RowGroup Value

I have looked through several of the posts on SSRS tablix expressions and I can't find the answer to my particular issue.
I have a dashboard I am creating that contains summary data for various managers. They are entering monthly summary data into a single table structured like this:
Create TABLE OperationMetrics
AS
Date date
Plant char(10)
Sales float
ReturnedProduct float
The data could use some grouping so I created a table for referencing which report group these metrics go into looks like this:
Create Table OperationsReport
as
ReportType varchar(50)
MetricType varchar(50)
In this table, 'Sales' and 'ReturnedProduct' are the Metric column, while 'ExecSummary' or 'Quality' are ReportType entries. To do the join, I decided to UNPIVOT the OperationMetrics table...
Select Date, Plant, Metric, MetricType
From (Select Date, Plant, Sales, ReturnedProduct From OperationMetrics)
UNPVIOT (Metric for MetricType in (Sales, ReturnedProduct) UnPvt
and join it to the OperationsReport table so I have grouped metrics.
Select Date, Plant, Metric, Rpt.MetricReport, MetricType
FROM OpMetrics_Unpivoted OpEx
INNER JOIN OperationsReport Rpt on OpEx.MetricType = Rpt.MetricType
(I understand that elements of this is not ideal but sometimes we are not in control of our destiny.)
This does not include the whole of the tables but you get the gist. So, they have a form they fill in the OperationMetrics table. I chose SSRS to display the output.
I created a tablix with the following configuration (I can't post images due to my rep...)
Date is the only column group, grouped on 'MMM-yy'
Parent Row Group is the ReportType
Child Row Group is the MetricType
Now, my problem is that some of the metrics are calculations of other metrics. For instance, 'Returned Product (% of Sales)' is not entered by the manager because it is assumed we can simply calculate that. It would be ReturnedProduct divided by Sales.
I attempted to calculate this by using a lookup function, as below:
Switch(Fields!FriendlyName.Value="Sales",SUM(Fields!Metric.Value),
Fields!FriendlyName.Value="ReturnedProduct",SUM(Fields!Metric.Value),
Fields!FriendlyName.Value="ReturnedProductPercent",Lookup("ReturnedProduct",
Fields!FriendlyName.Value,Fields!Metric.Value,"MetricDataSet")/
Lookup("Sales",Fields!FriendlyName.Value,Fields!Metric.Value,
"MetricDataSet"))
This works great! For the first month... but since Lookup looks for the first match, it just posts the same value for the rest of the months after.
I attempted to use this but it got me back to where I was at the beginning since the dataset does not have the value.
Any help with this would be well received. I would like to keep the rowgroup hierarchy.
It sounds like the LookUp is working for you but you just need to include the date to find the right month. LookUp will return the first match which is why it's only working on the first month.
What you can try is concatenating the Metric Name and Date fields in the LookUp.
Lookup("Sales" & CSTR(Fields!DATE.Value), Fields!FriendlyName.Value & CSTR(Fields!DATE.Value), Fields!Metric.Value, "MetricDataSet")
Let me know if I misunderstood the issue.

Resources