Total of Custom Expression - reporting-services

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.

Related

SSRS 2014. Show RunningValue Before Page Break

So I have this ssrs 2014 report, with a table in the body that has a LineAmount column
Say my report has 300 lines, and each page fits about 50.
Is there any way I can insert the SUM RunningValue of LineAmount at the bottom of each page? Ideally this Running value will not be in the last page.
So I know the formula es
=RunningValue(LineAmount,SUM,MyDataSet)
But I can't figure out, how to make the Page Break a trigger to display this amount
In short, you will need to add a row group and add a simple SUM() there. The row gorup will also force the page break.
Assuming you currently only have a 'details' row group (if not then you will have to decide at what level the row group needs to be)
You need to do the following....
First determine how many rows you can fit on a page, for this exmaple we will use 50 although you may have to reduce that to take account of the addiotnal row.
Right-clck the 'details' row group and choose "Add Group => Parent Group".
In the Tablix group dialog box click the 'fx' button next to the Group By drop down.
Set the expression to
=Ceiling((RowNumber(Nothing)) / 50)
Check the "Add group foter" option then click "OK"
Right-Click the new group you created and choose "Group properties". Click the "Page Breaks" tab and check the "Between each instance of a group" option.
Click the sorting tab and delete the sort. If you find data is not sorting correctly then sort by the same sort as your "details" group.
Click OK
You will now have a new row in your tablix. In this new row, in the LineAmount column set the expression to
=SUM(Fields!LineAmount.Value)
This will give you the total for that group and as each group is now a p[age full of data the group total shoudl give you what you want.
This is not the solution I was looking for, but if following the row counting approach, I think there is an easier way.
Just add a new row to the affected tablix
Set the row visibility to something like:
=IF(RowNumber("Table_Lines_Group2") MOD 20 ,TRUE,FALSE)
Here 20 is the number of rows that can fit the page
"Table_Lines_Group2" is the DataSet group you are counting rows on
In this new row, add the running total in one of the columns, Expr like for example:
=RunningValue(Fields!LineAmt_SalesInvoiceLine.Value,SUM, Nothing)
So basically, each 20 rows, you will get a running total

how can we separate totals on the basis of group

how can we separate the totals on the basis of column value. need to create a report which have multiple columns, every column have multiple values. need sum of every row group value. I have added sample as below. please help me regarding same.
This is as single as context clicking on your field and clicking "Add Total". Clicking this option will add a subtotal to your next group. Clicking again on that total will create a new total on the next group level until you eventually get to the final, grand total.

Moving subtotal to columns

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.

SSRS Report - Subgroup Totals

I have an SSRS report that is currently pulling a single dataset. This dataset contains records of inventory we have. Each record is a separate asset.
I want my report to group by a certain field, and then subgroup by certain criteria that are determined with a couple different fields. Basically there is one parent group, and three adjacent subgroups. My grouping functionality is working correctly, however I am finding it difficult to add totals to each of the adjacent subgroups. When I add a total, it is totaling the specific field within the scope of the entire dataset, instead of limiting the total to just that subgroup.
How can I add totals per field within subgroup?
EDIT: Added sample data and explanation:
You can ignore the function code field, that is what I am using to group on the parent group.
asset number,description,first year,acquisition cost,function code
190,random asset,2008,5000,100
193,random asset45,2008,56000,100
197,random asset26,2014,3000,100
191,random asset27,2014,7000,100
192,random asset36,2013,15000,100
I can't seem to attach screenshots, so here goes..
In the report you can see three subgroups; Assets, AssetAdditions, AssetDeletions. In the tablix, you can see where these groups are positioned. You can also see a row directly beneath the group that is supposed to total the subgroup at the end. However, for some reason the scope is only taking into account the entire dataset. I have tried to modify the expression in the Sum function [Sum(acq_cost), "Assets"], adding in the scope parameter but then it does not allow me to even run the report. It yells at me saying that "Assets" is an invalid scope.
The easiest way I have done this in 2012 VS is to have it return as part of the data set and have it sum up the value.
For instance if you have a quantity for inventory, and you have a subset where you only want the total quantity for that set, you add another column to your dataset called TotalSetQuantity and the subtotal field will have the expression =SUM(Fields!TotalSetQuantity.Value) rather than =SUM(Fields!Quantity.Value).
You can try iif statements within your report like =sum(iif(Fields!ColA.Value=1,Fields!Quantity.Value,0) but I had some troubles getting that to work.
Hope that helps, I ran into this issue this past week and the first option worked like a charm for me.

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