Dynamically add columns in SSRS - sql-server

I am tasked with creating a report in SSRS that can display data covering anywhere from 1 week up to 52 weeks.
What I am trying to avoid is writing a huge query that will pull all 52 weeks worth of data and have it show on the report, unless the user wants that data to appear.
So if the user wants January 1st - February 1st it will only show 6 columns of data instead of all 52 columns. How would I do something like that?

Easy - you need to use a Matrix.
A grid gives you a fixed number of columns and many rows.
A matrix gives you many columns and many rows.

Try this How to Create SSRS Report with Dynamic Columns

Create column grouping on your tablix, for example you have column WEEK and you are bringing data from 1st Jan to 1st Feb.
Column grouping on column WEEK will generate only 5 columns if you have data for every week.

Related

APEX 5: Adding subtotals in IR Pivot

I've created a pivot table using the Interactive Report Feature. The only total option it gives me is a grand total for each column, but I also want to include sub totals. For eg, in the below screenshot, I would like to see subtotals by region per week, apart from the grand totals per week. Is it possible?
You can get subtotals if the report has a Control Break, but not on pivoted columns. The way I'd approach this is to add an additional column "week" to the report query which truncates the date to the nearest week (e.g. trunc(mydatecolumn,'W'); put a Control Break on that (as well as region).

How can we include 2 datasets in SSRS table with row and column grouping

I have 2 different datasets. one for current month and another one for previous months data. I want to compare the data under a single SSRS table. The SSRS table has column and row groups. How can I relate it and get a combined report from those datasets. Please help.
If you are not using cumulative data, have you looked at using LookUp?
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/report-builder-functions-lookup-function

Summing the Non-Null results in a matrix

I have a report that looks like the picture below. It is a matrix with person name on the rows and weeknum on the columns. What I need to calculate is the number of weeks that have data in the calls taken column. In the picture below it is the consistency column with the red numbers. I can't seem to get those red numbers to appear. Is there an expression that can count the number of columns that aren't null in a particular matrix. This report will be dynamically generated and the number of weeks will be totally different each time.
I would rather solve this in SSRS because I don't want to mess with my SQL too much but if no SSRS solution is possible I can post my SQL and perhaps solve it that way.
You need to create a column group outside of the last group. So in your example, Right click on the column tab above your efficiency column in the 23rd week. After you create this column, you can use a simple Count(Fields!CallsTaken.Value) in an expression to count the times there are values listed.
Reference SO question on Horizontal Totals.

Repeat non-pivot column in SSRS

Referring to the image, I would like to repeat the salesagent column after every few rows. How do I do this in SSRS?
Note: My report will have a start and end date parameter for customers to choose. I will be using the date column for pivoting purposes. If a customer chooses to run the report for six months, they will have plenty of date columns so they are requesting to repeat the non-pivoted header column every seven days/column. Is it possible?
Let me know if more information is needed from me.

SSRS displaying data in a table when grouped by year

The below image shows the table in design view followed by how it looks when run. My problem is that if you look for example under the first 'Service' listed for February, there is a line for 2010's data then a separate lower line for the 2011 data.
I need the table to make use of the one line for that particular Month rather than splitting the data.
Found out that I needed to right click on Details in row groups and add my month field to use one row.

Resources