Link to home
Start Free TrialLog in
Avatar of NETFOCUS
NETFOCUS

asked on

Evaluate iif in a MAtrix

Does anyone know why this IIF statement only evaluates once when it is in a Matrix but works ok outside the matrix ?

=IIF(LTRIM(RTRIM(Fields!USERDEF1.Value)) <> ("OTHER")
AND (LTRIM(RTRIM(Fields!USERDEF1.Value)) <> "KEY ACCOUNT" AND SUM(Fields!ID0_3_MTHS.Value) >0 )
 ,Fields!NoinGroup.Value, SUM(Fields!ID0_3_MTHS.Value))
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Depends on the layout of you matrix. But shouldn't the formula be:
=IIF(LTRIM(RTRIM(Fields!USERDEF1.Value)) <> ("OTHER")
AND (LTRIM(RTRIM(Fields!USERDEF1.Value)) <> "KEY ACCOUNT" AND SUM(Fields!ID0_3_MTHS.Value) >0 )
, SUM(Fields!ID0_3_MTHS.Value) ,Fields!NoinGroup.Value)

Open in new window

Now you're only showing the sum if it's <= 0. I you need further help please provide a small sample of your data, the layout of your matrix, the desired result and the version of SQL Server.
ASKER CERTIFIED SOLUTION
Avatar of NETFOCUS
NETFOCUS

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
Avatar of NETFOCUS
NETFOCUS

ASKER

Making this change worked.