Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

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))
0
NETFOCUS
Asked:
NETFOCUS
  • 2
1 Solution
 
Nico BontenbalCommented:
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.
0
 
NETFOCUSAuthor Commented:
I had to add another column group with a constant value in it an now it works.
0
 
NETFOCUSAuthor Commented:
Making this change worked.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now