SSRS #ERROR in Expression field that sum the total debits - credits - reporting-services

When I calculate the total Debits in SSRS I get #ERROR. Not sure why the logic should work.
Any ideas on how to get rid of the #ERROR?
=SUM(IIF(Fields!strType.Value="CreditsAndDeposits",Fields!intDT.Value,0))
+SUM(IIF(Fields!strType.Value="Refunds",Fields!intDT.Value,0))
-SUM(IF(Fields!strType.Value="Rent_Tax",Fields!intDT.Value,0))
-SUM(IIF(Fields!strType.Value="Sales_Tax",Fields!intDT.Value,0))
-SUM(IIF(Fields!strType.Value="Cost_of_Insurance",Fields!intDT.Value,0))

Related

Calculate total sum for the grouping of child group using Aggregate sum or group by sum Expression

I am trying to calculate a sum based on Category of business
(Total sum of Type 1, Total sum of Type 2 and 3).
I created calculated fields for all 3 which is given below :
''=SUM(If(Fields!Category_of_business.Value="Type1",Fields!Selling.Value,0))''
For which I am getting an error that Aggregate functions are not allowed in calculated fields. Is there any workaround? Visual rep of SSRS table

how to do division in sub total in SSRS

I developed a SSRS report. The output is as below
Here i have subtotal for amt, cust and Tbl. I need subtotal for Avg also.
I tried below formulas in the subtotal columns
=[Sum(total)]/[Sum(cust_count)]
and the output is as below
How can i achieve the same?
You can use this expression:
=Sum(Fields!amt.Value) / Sum(Fields!cust.Value)
Assuming that:
Sum(Fields!amt.Value) is the expression used to obtain 183.00 in you example
Sum(Fields!cust.Value) is the expression used to obtain 8.00 in you example

Reporting services get total sum

I want to get the total sum of a particular column in a report. I have tried using =Sum(Fields!baseline_number.Value) but this gets the sum for each row and when I use
=RunningValue(Fields!Quantity.Value, Sum, Nothing)
I get the cumulative sum. I wouldn't mind using =RunningValue(Fields!Quantity.Value, Sum, Nothing) then getting the final value because this would be the sum for all the rows. Is there a simpler way to achieve getting the total for a certain row in a report?

SUM of a SUM in SSRS 2008

I've this report
Here I make the first sum because I've grouped values from each month (months are "Gennaio", "Febbraio", "Marzo" etc etc.). These values are hidden, but anyway I get the sum and I display the sum for each month.
Then I should make the second sum that use values for each month and display the total for each category. Categories are "TOTALE LAVORI RESTAURO", "TOTALE LAVORI EDILE" etc.)
This is the final sum, where I sum values from each category.
Everything is working well, but now I have to add a "month" parameter to the report that returns sums until a selected month. This parameter changes the sum 1 with this expression:
=Sum(IIf(Fields!mese.Value <= Parameters!mese.Value, Fields!costi.Value, 0))
Now, how should I change expression in SUM2 and SUM3 to work with this parameter?
If I copy that code, ther returns #Error and as far as I know I can't use ReportItems sum.
So any suggestion?
SUM #1 could remain Sum(Fields!costi.Value) because you need to display every months.
i.e.: display GIUGNO even if Parameters!mese.Value = 4 (APRILE).
So you have only to change SUM #2 and #3 because TOTALE LAVORI RESTAURO and TOTALI must show only costi from GENNAIO to Parameters!mese.Value; i.e. if Parameters!mese.Value = 4 display only GENNAIO-APRILE even if we have details about GIUGNO.
The expression gave error because you have NULL value in Fields!costi.Value or Fields!mese.Value: convert this value to zero in your DataSet and you won't have problems.

SQL Server Reporting Services Running Total Over Aggregated Data

Everyone,
In SSRS, we have 2 columns as laid out below.
Sales | Running Sales
5.00 | 5.00
3.00 | 8.00
1.00 | 9.00
The distinction is that the first column (sales) is a is a grouping row and thus to get a Total for Sales per row, we are using =Sum(Fields!Sales.Value).
The problem occurs that when I try to use running value to get a running sales total. It gives me the SSRS error that Aggregate functions can only be used on page headers and footers. In this case it makes no sense to have the total in the footer. Does anyone know a solution/workaround to this problem.
Thanks.
I had the same problem; here is how I solved it.
So here is how to subtotal a column that is itself a sum function. SSRS 2005 wont allow you to aggregate an aggregate function. For example, the total of a column showing a Running Total, useful in daily stock balance calculations.
Add the following code to the report Report > Properties
Dim public totalBalance As Decimal
Public Function AddTotal(ByVal balance As Decimal) AS Decimal totalBalance = totalBalance + balance return balance
End Function
Public Function GetTotal() return totalBalance
End Function
This code adds two variables: totalbalance and cnt as decimal numbers. And two functions AddTotal and GetTotal.
AddTotal allows items in rows to be added up, use as follows in a value cell, where you had;
=RunningTotal(Fields!ColumnName.Value,sum,nothing)
with
=Code.AddTotal(RunningTotal(Fields!ColumnName.Value,sum,nothing))
in the total cell, where it you were unable to simply use
=sum(RunningTotal(Fields!ColumnName.Value,sum,nothing))
use instead
=Code.GetTotal()
Simply add more variables and public functions if you need to sum the sum of more that one field.
http://blog.wingateuk.com/2011/09/ssrs-aggregate-of-aggregate.html