Group expression gives #Error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Group expression gives #Error

I have an expression such as: =sum(
IIF( Fields!QuantityType.Value="LB", Fields!TotalQuantity.Value ,0)
,"Grp_Number" ) ….Grp_Number is the grouping where I’m trying to insert this summation / total. Under Grp_Number, I have a 2nd grouping by QuantityType, where there’s two possible values, LB or NLB. So, a Grp_Number could have possible 2nd groupings of: 1. only LB 2. only NLB 3. both
The only problem is when there’s no LB, then the expression comes back as #Error. Any suggestions are welcome! Thanks!

Is Fields!QuantityType.Value return nulls? If so you could try putting an ISNULL around it like: =sum(
IIF(ISNULL(Fields!QuantityType.Value,”)="LB", Fields!TotalQuantity.Value ,0)
,"Grp_Number" )
ya, if the field is returning null, the field will render #error, however, if you only see the #error when you are viewing the report on IE, then it will be security issue. Some changes needed to be done on the reporting server’s config file…