Link to home
Start Free TrialLog in
Avatar of GaleMellinger
GaleMellinger

asked on

InScope Function in SSRS

We're trying to count a grand total at the very end of our report.  We have 2 lists with totals that work fine.  However, when we try to perform the grand total, with the expression outside the list box, we get an inscope error.  If we move the expression inside the list box, the totals aren't giving a grand total.  How do we write the correct inscope function?  Here is the current expression that is giving the errors:

="Grand Total -    Inspections:    " & CountDistinct(Fields!INSP_ID.Value, "Compliance") & 
";    Inspections With Violations: " & CountDistinct(IIF((Fields!VIOL_ID.Value, "Compliance") > 1, (Fields!INSP_ID.Value, "Compliance"),Nothing)) &
";    Violations:    " & CountDistinct(Fields!VIOL_ID.Value, "Compliance") & 
";    Enforcements:    " & CountDistinct(Fields!ENF_ID.Value, "Compliance")
Avatar of TempDBA
TempDBA
Flag of India image

Its because the grouping is not valid outside the list. Make a wrapper group and try adding them in the wrapper group.
Avatar of GaleMellinger
GaleMellinger

ASKER

Can you please provide details on how to make a wrapper group?  Are you referring to a parent group?
ASKER CERTIFIED SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, its parent group. Just do grouping without the field which is involved in the total.
Thank you.