0

I am trying to add an expression in header section, which would display parameter value chosen by users (if everything selected, display "ALL" instead). I am having trouble with "Property" parameter.

Report structure: Report is a matrix report that shows data by year and grouped by refBuildingID. Parameter "Property" is based on RefBuildingID. I want to show these parameter values in header when users run this report.

Expression:

=IIF(Countrows("BuildingID")=(Parameters!refBuildingID.Count),"All",Join(Parameters!refBuildingID.Value,", "))

Error: The Value expression for the text box ‘Textbox31’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.

Is there a way to get around this error?

enter image description here

NonProgrammer
  • 1,337
  • 2
  • 23
  • 53

2 Answers2

0

Try this method:

=IIF(Count("BuildingID")=Count(Parameters!refBuildingID.Value),"All",Join(Parameters!refBuildingID.Value,", "))

SuperSimmer 44
  • 964
  • 2
  • 7
  • 12
  • I no longer get an error, but now it says "ALL" for any selection I make. – NonProgrammer Apr 17 '17 at 13:22
  • 1
    I see the error, quite rightly so. please attempt this method ("DataSet2" is the initial source of the parameter) =IIF(CountRows("DataSet2").Equals(Parameters!refBuildingID.Count),"All",Join(Parameters!refBuildingID.Value,", ")) – SuperSimmer 44 Apr 17 '17 at 20:24
0

i think CountRows will work

=IIF(COUNTROWS("BuildingID").Equals(Parameters!refBuildingID.Count),"ALL",Join(Parameters!refBuildingID.Value,", "))
Vu Cao
  • 1
  • Getting following error when trying your solution: The Value expression for the text box ‘Textbox44’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset. – NonProgrammer Apr 17 '17 at 20:02