Working with SSRS dynamic fields - reporting-services

SSRS matrix table is a great way to generate dynamic fields as long as values exist.
However, is there a way to "always" show these dynamic fields even if a value doesn't exist for them? The report field locations varies based on data availability and users have to add missing columns in Excel manually.
Dynamic fields go from 3 to up to 30 (at least for now based on run by values). Adding these values manually would make the report hard to maintain.

The way I have handled for this is in the SQL. I build a table of all the values I will always want, I cross join that table to my final output table and update/insert values where they need to exist. That way I guarantee the rows, and eventually columns in the matrix, exists even if they end up being null.
Does that make sense?

Jesse's solution is a good one, but if for whatever reason you can't or prefer not to change the SQL you can do it in SSRS by forcing a blank value in the cell with a expression like this:
=iif(IsNothing(Fields!.xxx.Value)," ",Fields!.xxx.Value)

Related

How can I create a table that uses an equation to average data from another table?

I have a table that contains data from repeated experiments (for example, site A has one sample, and the lab processed the sample three times obtaining slightly different values). I need to average these results in a separate table, but what I have read on the Microsoft support site is that a query that pulls data into another table with a calculated field is not possible on Access.
Can I query multiple data points from one table into a single calculated field in another table? Thank you.
UPDATE
I ended up doing a lot of manual adjustments of the file format to create a calculated field in the existing table that averages each sites data, so my problem is, for my current purposes, solved. However I would still like to understand. Following up with you both, I think the problem was that I had repeated non-unique IDs between rows when I probably should have made data columns with unique variable names so that I could query each variable name for an average.
So, instead of putting each site separately on the y axis, I formatted it by putting the sample number for each site on the x-axis:
I was able to at least create a calculated field using this second format in order to create an average value for each site.
Would have there been a way to write a query using the first method? Luckily, my data set was not at all very hefty, so I could handle a reformat manually, but if the case were with thousands of data entries, I couldn't have done that.
Also, here is the link to the site I mentioned originally https://support.office.com/en-ie/article/add-a-calculated-field-to-a-table-14a60733-2580-48c2-b402-6de54fafbde3.
Thanks all.

Add filter option on each column of the data displayed in SSRS

I am generating a table in SSRS based on the selection made by the user on two filters: Filter1 and Filter2 (say). The table so displayed has 10 columns and I wish to add filter option listing all available values for that column for all 10 columns.
Basically, I am trying to replicate the Excel functionality of filtering down data on each and every column.
Please note that I tried creating a new data set and a parameter taking all distinct values for a particular variable. However, I am still not able to get the desired results by filter the tablix on that parameter
Is there a way I can do that?
You'd need to make a new dataset that is a smaller version of your main dataset. It would need to return all potential values for the column(s) you want to filter in a single column to be used in a parameter.
Without seeing the design of the report or the dataset itself it's quite hard to be more specific.

Report containing sums from different queries in Access

I am currently working with different tables and queries in Access and I can't find a way to do something very simple. I have the following :
Two queries, qry1 and qry2
One table, tbl1
Both queries and the table have a "NET" field of type float (or double)
What I'd like to do is create a very simple report which would give me the total of the NET column for each of those three objects. I have tried to insert a text box in a blank report and selecting sum(NET) on qry1 in Control Source but it doesn't work, it simply prints '#Error' with no more information.
If I use 'Add Existing field' and drag&drop 'NET' from tbl1 and then edit it to add sum it works but it is repeated for each row which is obviously not what I want. It feels like I'm missing something here or that I might not be using the right tool.
Thanks in advance for your help!
Have you considered the DSum() function? Create three text boxes and set the control source for each text box as follows:
=DSum("NET", "qry1")
=DSum("NET", "qry2")
=DSum("NET", "tbl1")
Note: Aggregate functions (e.g., DSum, DLookup, etc.) have poor performance compared to performing the calculations within a query. It's not clear from your question whether that's an option for you or not.

Get value of table row

I've got two tables binded to two different datasets. I'm trying to reference one of the rows from one of the tables (Table A) from Table B.
Since it's outside the scope of the table, I can't use ReportItems![Textbox name].Value
Any ideas?
You can use the SSRS Lookup() or LookupSet() function to retrieve the data directly from the other dataset.
I found the MSDN pages a bit unclear, the syntax goes like this:
=LOOKUP(Fields!sourceMatchingField.Value,
Fields!targetMatchingField.Value,
Fields!targetReturnField.Value,
"Name of Second Dataset"
)
Fields!sourceMatchingField.Value is from the dataset that is
currently in scope.
Fields!targetMatchingField.Value is from the other data set you need to get information from and equals Fields!sourceMatchingField.Value.
These two parameter values for the Lookup function make the join criteria for the two datasets. They can be more complicated than simply two field references (such as using functions to manipulate on or both), but I'm just showing the simplest way to do it.
Fields!targetReturnField.Value is the field from the second dataset that you want to return. This should just be a reference to a field.
"Name of Second Dataset" is just what you've named the other dataset that you're joining to.

How can I get empty columns to appear in SSRS reports?

I have a report that groups hours by the environments in which work was executed. Some customers are in all environments (Beta, PPE, Staging, and Production), whereas other customers are only in a subset of environments. If a customer is only in a subset, then there is no column for environments where no work was executed in that section of the report and as a result, there is white space on the right side of that section for each column that is "missing."
Is there a way for me to force the report to list all environments for all customers, even if there is no data for a given environment/customer combination?
Thanks.
I can think of a couple of options here.
One is to use a table with a set number of columns for all required environments, instead of relying on the required columns being dynamically generated by a matrix type object, and then filling the columns' values with appropriate conditional expressions, e.g. for the PPE column use something like:
=Sum(IIf(Fields!Environment.Value = "PPE", Fields!MyValue.Value, Nothing)
The other option is to change the Dataset to always return a row for each environment, i.e. if you're getting the data from a T-SQL query you'd use something like Environments as the base table and LEFT JOIN it to all the required value data, i.e. always returning each Environment row even if no values exist. This way you could still use a matrix to dynamically generate your columns.