SSRS - Calculated field using column from other DataSet in Matrix (cross-tab) - matrix

I have several DataSets in an SSRS report. How can I use a summed matrix (crosstab) column from one DataSet in a formula of another DataSet with the same data fields (just different selection criteria (categories differ)). When I specify that field in the other DataSet, it only gives me First every time (I did not use First()); it does not automatically move them with the crosstabs in the second DataSet.

You cannot do this in SSRS 2008. This capability is first available in SSRS 2008 R2. Depending on how you use the data in the report layout, you might be able to use the ReportItems collection to get a value. For example, you can use the contents of Textbox1 with a field in a different dataset (field called MyColumn1) in an expression like this:
=ReportItems!Textbox1.Value + Fields!MyColumn1.Value
The ReportItems collection uses the value of a textbox after the page is rendered, so you get the result only and not the raw data so you'd have to be using raw data.

Related

Oracle Reports (6i): Get difference of two items from two different queries (Multi Query Report)

I have an Oracle 6i report with Two Complex Queries (Q1 and Q2) connected by Data Link. The report was developed by some other developer who is not available now. Multiple columns are being displayed in report.
Q1 has a column Total_Issuance and Q2 has a column Total_Consumption. I have to display their difference on report. I am using a formula column to get the difference and then binding a display field to this formula column to show on report.
But since the formula column is outside both the queries, I am getting following errors.
REP-1517: Coloumn 'CF_1' references column 'Total_Issuance', which has incompatible frequency.
REP-1517: Coloumn 'CF_1' references column 'Total_Consumption', which has incompatible frequency.
Just like the formula column is outside both queries, create two additional summary columns (outside of both queries):
cs_tot_iss, which will sum total_issuance
cs_tot_con, which will sum total_consumption
Now modify formula column so that its source are newly created summary columns, e.g. let it
return :cs_tot_iss + :cs_tot_con;
As of paper layout: you don't have to display cs_tot_iss nor cs_tot_con (as you already have those values via total_issuance and total_consumption), just add formula column.
Create a new calculated field to the query that is the detail query (I asume it's Q2).
In this calculated field you can simply use:
return :Total_Issuance - :Total_Consumption;
to calculate the difference.

Is there a way in SSRS to highlight an interactively sorted column

I have a report with several interactive sort columns for sorting/ranking various metrics. I would like to highlight the column or even just the column header that is sorted. Is there a property that will tell me which column the report is sorted on?
I have not been able to find any threads that address this question.
No - there are no properties in SSRS to let the code know that the column is being sorted.
If you wanted to put in the effort, you could add a parameter with column names for the sorting. Then just set the table or Groups SORTING by your parameter using a Switch statement and the background color of the header and/or data cell(s) using an IIF for each column for the color.
SORT EXPRESSION:
=SWITCH(Parameters!SORTING.Value = "NAME", Fields!NAME.Value,
Parameters!SORTING.Value = "AGE", Fields!AGE.Value)
Background Color Expression for a NAME column:
=IIF(Parameters!SORTING.Value = "NAME", "Whitesmoke", "White")
For the other columns, just use the column name.
To be a little slicker, you could use the ACTION on the column header for each field to set the parameter and recall the report rather than forcing the user to hit View Report. You would Specify the same report but Add the SORTING parameter and hard code the columns name (which has to be the same as the SWITCH function).
Unfortunately, this would require the report to rerun each time the user wanted to sort.
Kinda lame but it's the only way that I can think of to do it.

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.

Can I receive data from .rdlc Report Parameters?

I have a VS 2010 Report, and I would like to pass values that are calculated inside of one .rdlc report to another. Can I somehow use the Parameters to send data back out of the report, or have some "return" value from the .RDLC?
I don't think you can have return values with report services.
Instead, assuming that the two report have different dataset, the only solution I come out so far is to include two dataset in your second report and recalculate your field.
Doing that, you can use your normal expression to calculate the values that you need from the first report specifying the first dataset.
Here really simple example:
Report 1
The report is using only the DataSet1
=Fields!AField.Value
Report 2
The report is using two dataset: DataSet1 and DataSet2
=(Fileds!AField.Value, "DataSet1") + (Fields!AnotherField.Value, "DataSet2")
Ofc the expressions could be more complex, but the most important thing is to specify the DataSet where the report have to take the filed.

Resources