all groups > sql server reporting services > september 2005 >
You're in the

sql server reporting services

group:

expression problem


expression problem Tango
9/25/2005 6:14:01 PM
sql server reporting services:
Hi There
I am trying to sum the amount value in the budgets dataset based on a sub
catagory within the budgets table called personal loans.
my expression is

=Sum iif(Fields!Sub_Catagory.Value, "budgets" = "Personal Loans",
Fields!Amount.Value, "budgets", Nothing))

this sits within an actuals table that uses a different dataset

could i please have some assistance as to where i am going wrong. error
message is The value expression for the textbox ‘total_budget’ refers to the
field ‘Sub_Catagory’. Report item expressions can only refer to fields
within the current data set scope or, if inside an aggregate, the specified
data set scope.

Thankyou


Re: expression problem Bruce Johnson [MSFT]
9/26/2005 2:56:17 PM
The following link discusses conditional expressions:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_3983.asp


--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Re: expression problem Jens Konerow
9/26/2005 4:21:42 PM
If I understood you right: You want to sum the Amount (within one dataset)
if the sub_category is "Personal Loans" (within another dataset). try this:

= Sum(iif(Fields!Sub_Category.Value = "Personal Loans", Fields!Amount.Value,
0))

syntax:
iif( expression, what to do if the expression is true, what to do if the
expression is false)

I wasn't able to test the expression, because i have no report server
running at the moment.

"Tango" <Tango@discussions.microsoft.com> schrieb im Newsbeitrag
news:EE09B408-6D43-4774-BC61-8D5A999EDF4B@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button