Moving subtotal to columns - reporting-services

I believe my problem has to do with the grouping structure.
This is my original report structure where there are detail rows and then a subtotal row:
I need to move the subtotals to columns Hdr Qty. Ordered, Hdr Qty. Remaining, etc. but because it's in the same groupings as the rest of the data it simply repeats that data although I put them into sum functions. I also need to show the details rows still which will end up duplicating the subtotals but that's what I need.

Delete the "table1_Details_Group" group. Make sure you select "Delete group only" so that it doesn't delete the whole row. You want that row to be grouped by Vendor, not by details. Then the sum function in each row will be able to aggregate the values at the vendor level.
EDIT:
If you still want to see the details, you could specify the scope for the aggregate. Like this:
=Sum(Fields!QTYORDERED.Value, "VENDNAME")
If you're still not getting what you expected, you may want to consider a subquery to get the aggregates at that scope.

Related

SSRS - Merging cells of specific columns

I am developing a complex report in SSRS which should like below
Screenshot 1
output returned by stored proc have multiple rows of one User ID and based on that columns "Successful Orders -- Online - Total Orders", "Successful Orders -- Online - Total Amount" & likewise Retail - Total, Other - Total columns cells should be merged based on respective User Id.
I have used tablix control and tried adding grouping over columns which needs to be merged but it is not working as expected. in order to group I am setting Sum of returned Value in cell but yet no luck.
Can you please provide me some pointers in order to achieve whats expected. please let me know if you need more information
output after adding nested tablix
ScreenShot 2
also, distorted output with inner tablix. borders are causing issues
ScreenShot 3
Try placing a tablix in the cells containing the multiple rows to display them. Basically, you need to switch your approach from "How do I merge these cells?" to "How do I split these cells." Set up your grouping at the level you want your totals and then in each of the columns where you want the details displayed, add a tablix to display the details. You'll need to play with the grouping a bit to get it display correctly.
More details:
The sample you provided above should be one group level row, not multiple detail level rows. Add your group to that Tablix and the summaries you want for your Total columns. Then Merge each of the "Mode" and "Count" column pairs and insert a Tablix into that merged cell with the same grouping as the row with the Totals, but with only the Details row displayed (don't add group header or footer and delete the blank row and summary column that automatically gets added). Now just set your field values for Mode and Count and adjust your column widths to match the headings.
Here's a REALLY simple report that displays a Plant and the employees associated with that plant. This is the top level where you Totals group would go. The next image is the "inner" part, where you would add in another Tablix with the same group(s), but only the details displayed.
This is super simple example and you may need to include additional levels of grouping to match your report, but the fundamentals still the same - an "outer" Tablix with an "inner" Tablix with matching group(s).
There's a lot you can do with this approach by manipulating the groups, hiding/displaying different groups or even hiding the details and displaying subtotals.

Total of Custom Expression

I'm trying to get the total of the "Conversion" column for each "AccountDescName".
However, the expression inside is also grouped by the statdate.
How would I go about getting the total of the conversions.
When I paste that same expression in a row below, it gives me a different number.
In order to get a subtotal by account, you'll want to add a new row that is inside that group, but outside the StatDate group. Right-click on the field that was highlighted in your first screenshot. Select "Insert Row" -> "Outside Group - Below". This new row is where your subtotal will go. You can usually copy the same expression here and it will evaluate within its new scope.
For a grand total, you would follow similar steps, but you would insert the row outside the account group. This would result in one final row at the end of the entire table.
I figured it out by keeping my data split up by rows and removing duplicates.
Did not do any aggregation in SQL.

SSRS - calulcate sum of rows in a separate column

Is it possible using SSRS report (Tablix) to generate a report in the following format. The details need to be maintained while the total amount needs to be displayed in merged cells.
Desired Output
Current Output
To my existing report i added a group under details. What i got was that the row collapsed into a single record as below
Any help is appreciated. Thanks.
You cannot get this in the format you require.
You are grouping by TransactionID then by the separate amounts (I used a rowID for this to get a unique ID to group on), which means that at the point where you want the merged cells you are grouping by a unique transaction amount. You cannot then group back out to TransactionID.
You can swap the fields over - the total before the amount column. This will work, but likely look wrong for your requirements.
Have a read about data regions (https://technet.microsoft.com/en-us/library/ms156394(v=sql.100).aspx) and grouping (https://msdn.microsoft.com/en-us/library/dd255263.aspx) to understand more about the issue.

SQL Server Report Builder - Show Count of Sub Groups

I have a SQL Server Reporting Services report that shows customer order data, but it's grouped as follows:
Store
Customer
Customer Order Items
So, each report is a grouping of stores, with a subgroup of customers per store, and then the items per customer. I'm trying to show aggregate sale and other information at each header record of the appropriate group in the report. Most of this is working well, but for each store header record, I want to show a count of the customers. I'm trying to use some variation and\or combination of RowCount, CountDistinct and other aggregate functions, but to no avail.
Can anyone help me determine how I essentially can get a "count" of customer groups to show at the Store level header? TIA!
CountDistinct on Customer should work fine - no need to specify scope if it's in the Store group header row.
I put a simple test together.
Data:
Report in designer:
Most important thing to note is the CountDistinct on Customer in the Store header row; this is just the expression used:
=CountDistinct(Fields!customer.Value)
End result, showing correct values:
Please let me know if I'm missing something.
Edit after comment:
Apologies in advance for how long this is getting.
The previous report did have row groups for Store and Customer, but I've modified this to make it more clear, hopefully. Still based on the same DataSet:
You can see there are three row groups, and each row in the report is actually a group header row belonging to one of those groups.
In the Store group header row I've kept that same CountDistinct expression. I've also added a CountRows() expression to show how many actual rows are available in each of the different groups.
Here you can see for Store1, CountRows is returning 4, i.e. there are four rows that we are aggregating in this scope, which is what we expect looking at the DataSet.
Similarly, when we apply =CountDistinct(Fields!customer.Value) in the Store scope we are considering these same 4 rows, and we see two distinct customers for Store1, which seems correct to me.
For Store2 we are considering 6 rows in total, which have three distinct customers. Again, just by applying =CountDistinct(Fields!customer.Value) we get correct value.
Hopefully this rejigged report helps clear things up. If I'm still not getting your requirements, can you please explain what numbers are wrong in my sample report based on my sample DataSet? That way I can adjust things easily on my side.

Exclude hidden table row from total

I've created a table with a group filter so some values stay hidden.
However, the row that shows the sum() of the above values, still counts the filtered values.
Usually I would apply the filter to the query, but I'm also using this same dataset in other tables on the same report so that's not an option.
Am I missing something here, or is this a flaw in MS Reporting Services?
This appears to be a "feature" of SSRS, apparently because it calculates values in table headers and footers before rendering the detail section of a data table.
One way around this would be to add a derived Boolean column to your dataset (assuming your data source is SQL Server, using a CASE statement or similar) showing whether the row should be excluded from the table where the filter is required.
You can then change your table filter to check the indicator, and use a expression to carry out a conditional sum to aggregate the correct total. Something like
=SUM(Iif(Fields!ExcludeRow.Value = True,0,Fields!ValueToSum.Value))
It's more of a question than answer...
How to resolve this issue if you know whether the row is hidden or not ONLY at the Row Group level?
i.e. if you're filtering on the totals by this Row Group, i.e. you cannot have a field indicating if Row is excluded or not in a dataset.
ex: I have AR Aging report which has totals per months, patients. I need to filter out negative totals per patients (Patient row group), but I have column groups as well - per month, so my dataset cannot be per-patient granularity and therefore, the only place SSRS can decide whether to hide or show the row is on the Row Group level...
I had the same issue but I had too many column totals where to enter the Iif().
I resolved it by removing the filter from the group and putting the filter into the Tablix Properties dialog box (Select Tablix, Right-click the top left corner grey box and choose Tablixc Properties).