0
votes

My report has two datasets, main one and a second dataset (which holds only one row). I need to count how many values of a certain column in the main dataset are below a value taken from the second dataset. The expression I use is:

=Count(IIf(Fields!TestValue.Value < First(Fields!NetUnitWeight.Value, "SecondDataSet"), 1, Nothing), "MainDataSet") 
     & " of " & CountRows("MainDataSet")

But I get the following error:

[rsAggregateofAggregate] The Value expression for the textrun 'Textbox1.Paragraphs[0].TextRuns[0]' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.

I tried to solve it by putting First(Fields!NetUnitWeight.Value, "SecondDataSet") in a report variable, but this didn't work. How can I solve it?

1

1 Answers

0
votes

OK, I found a workaround. I added a new report parameter, right-clicked it to open its properties, then clicked "Default Values". I selected "Get values from a query" and chose the dataset and value field I needed. Now this expression works without errors:

=Count(IIf(Fields!TestValue.Value < Parameters!NetUnitWeight.Value, 1, Nothing), "MainDataSet")
& " of " & CountRows("MainDataSet")