Solved

Evaluate iif in a MAtrix

Posted on 2012-03-16
3
420 Views
Last Modified: 2012-03-25
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
Comment
Question by:NETFOCUS
  • 2
3 Comments
 
LVL 22

Expert Comment

by:Nico Bontenbal
ID: 37729313
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
 

Accepted Solution

by:
NETFOCUS earned 0 total points
ID: 37741725
I had to add another column group with a constant value in it an now it works.
0
 

Author Closing Comment

by:NETFOCUS
ID: 37762348
Making this change worked.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question