all groups > sql server reporting services > october 2006 >
You're in the

sql server reporting services

group:

Query Problem


Query Problem Wayne Wengert
10/10/2006 1:47:50 PM
sql server reporting services:
I am using the query shown below but I am not getting the result I expect. I
want to get "Elected" only when the count of LastName field is 75% or more
of the count of when the "CG" field is equal to "Y". What did I mess up
here?

============================
=iif(Count(Fields!LastName.Value) < Count(( Fields!CG.Value)="Y")*0.75, "Not
Elected", "Elected")

============================================

Re: Query Problem RajDeep
10/11/2006 2:26:54 AM
Hi Wayne

Count(( Fields!CG.Value)="Y"), i think you can't do this,the
architecture of the RS is such a way that it calculates all the
aggregations and operations first and then will come to the
conditional Expressions next,
here it is messed up with Expressions first .where you are unable to
get the result

As an alternate you can do this
1) Create an extra column Extra1 by going to dataset-->Fields
it must be a calculated field (not dataset field), give like this
IIF( Fields!CG.Value="Y",1,0)
2)Add another column extra2 with sum(Extra1) .
2)Go to the layout ,add extra column to the right of the column
wherever you want,give the expression like this
=iif(Count(Fields!LastName.Value) <First(Extra2), "Not
[quoted text, click to view]

i am not that much confident that it will work, but readjusting all
this expressions should work

Regards,
Raj Deep.A





[quoted text, click to view]
Re: Query Problem Wayne Wengert
10/12/2006 1:18:19 AM
Thanks for the suggestions. I'll give that a try.

Wayne

[quoted text, click to view]

AddThis Social Bookmark Button