APEX 5: Adding subtotals in IR Pivot - pivot-table

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).

Related

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.

Dynamically add columns in SSRS

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.

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.

SSRS: repeat tablix left-most row group value on each row

I have a tablix in an SSRS 2008 report. It has two-level row groupings, and I'd like the value for the left-most grouping to continue to be displayed on each row. Eg, I get this:
group1 subgroup1 500.00
subgroup2 250.00
... but I'd prefer...
group1 subgroup1 500.00
group1 subgroup2 500.00
I can't seem to find the option for this. Is it a strange thing to want?
Thank you,
Bill
You can simply edit the upper reporting level, to be grouping on both groups at the same time, this will cause your desired behaviour.
I had to resort to this solution once, where "hide duplicates" didn't seem to achieve the desired result.
It's so simple...you have to right click on the cell in the DATA area (ex. where is displayed the value 500) and to click add COLUMN on the left. After this change the value in the new cell with the label field (subgorup1), also do this for the others columns that you want to add, but remember to do it from the DATA area. when you finish, delete the columns out of the data area, but keep the row groups. nice try!
Currently, what I've found to be a good way of determining whether or not the repeated values of a group would show up in a SSRS report, is to create the Groups and build your report based on the groupings. Secondly, take the groups fields and duplicate the column to the right hand side of the report. Making sure that you've included all the columns needed and totals are correct; delete the grouped columns. When you do this, you will get a popup asking if you want to delete the group or just the columns, chose columns - this will keep the format of the initial report and keep all of the total line as well.
If you select the row in question, there is a field called Hide Duplicates. Set this to nothing (null, space, etc) That should return the values you want.
I had this same issue and I solved it really easily.
It seems you have two row groups, by group and by subgroup.
What you have to do is to select the first column and group by group and by subgroup and remove the grouping by subgroup.
That should do the trick.
Put ROW_NUMBER() OVER (ORDER BY name ASC) AS Row# in each query as a serial number and hide the row in the SSRS Report.
See: https://learn.microsoft.com/en-us/sql/t-sql/functions/row-number-transact-sql?view=sql-server-ver15

Resources