1
votes

When the following IIF expression is true, the row gets a 1 and if false the row gets a 0.

=IIF(Fields!MatchField.Value = "No match" and Fields!X.Value >= 1000, 1, 0)

What I want is to calculate the total sum of the column. If I use the same expression in the column group, the sum is always 0. If I use the textbox value of the row like this:

=SUM(ReportItems!Textbox41.Value)

The report returns an error:

Aggregate functions can be used only on report items contained in page headers and footers

Update #1

I implemented the solution from the link in Kavin's answer, but every total_sum is still 0.

Public Total_lookup_Sum As Integer = 0 

Public Function Lookup_Sum(ByVal value As Integer) As Integer

    Total_lookup_Sum = Total_lookup_Sum + value    

 Return value 

End Function
2
linkSachu
possible duplicate of Sum total of report columnIndian
@Indian edited the questionCitizen SP

2 Answers

2
votes

I solved this issue tby adding a calculated field (name:testField) to the dataset with the expression:

=IIF(Fields!MatchField.Value = "No match" and Fields!X.Value >= 1000, 1, 0)

After this you can easily sum the total:

=SUM[testField]
0
votes

Do the Following Given in this Link:

Forum 1
Forum 2

or

Try This:

=SUM(Fields!YourField.Value)