Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Sunday, February 19, 2012

counting when expressions is met

Am having trouble getting an expression to work that performs a count on a
different datset within a table. Firstly is this possible. In other words
table is based on dataset a but i want to have a colum that counts a field in
dataset b based on criteria. (ie field = 174). ThanksJust try this:
=Sum( iif(Fields!SomeFieldNameFromDatasetB.Value = 174, 1, 0), "b")
Note: If your condition is more complex and based on the current value of a
field in dataset A, then you have to work with subreports and pass the field
value from dataset A as parameter to the subreport.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tango" <Tango@.discussions.microsoft.com> wrote in message
news:6AA0A8A4-17EC-40E0-92FC-1E91D3932219@.microsoft.com...
> Am having trouble getting an expression to work that performs a count on a
> different datset within a table. Firstly is this possible. In other words
> table is based on dataset a but i want to have a colum that counts a field
in
> dataset b based on criteria. (ie field = 174). Thanks|||thanks robert ill try it in a sec, what does the lower case 'b" do.
"Robert Bruckner [MSFT]" wrote:
> Just try this:
> =Sum( iif(Fields!SomeFieldNameFromDatasetB.Value = 174, 1, 0), "b")
> Note: If your condition is more complex and based on the current value of a
> field in dataset A, then you have to work with subreports and pass the field
> value from dataset A as parameter to the subreport.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Tango" <Tango@.discussions.microsoft.com> wrote in message
> news:6AA0A8A4-17EC-40E0-92FC-1E91D3932219@.microsoft.com...
> > Am having trouble getting an expression to work that performs a count on a
> > different datset within a table. Firstly is this possible. In other words
> > table is based on dataset a but i want to have a colum that counts a field
> in
> > dataset b based on criteria. (ie field = 174). Thanks
>
>|||The lower-case b is the name of the second data set (which represents the
scope for the aggregate function). Every aggregate function has an optional
scope parameter.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tango" <Tango@.discussions.microsoft.com> wrote in message
news:4D0E11A9-ED32-4703-8131-CFC61B671BC0@.microsoft.com...
> thanks robert ill try it in a sec, what does the lower case 'b" do.
> "Robert Bruckner [MSFT]" wrote:
> > Just try this:
> > =Sum( iif(Fields!SomeFieldNameFromDatasetB.Value = 174, 1, 0), "b")
> >
> > Note: If your condition is more complex and based on the current value
of a
> > field in dataset A, then you have to work with subreports and pass the
field
> > value from dataset A as parameter to the subreport.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Tango" <Tango@.discussions.microsoft.com> wrote in message
> > news:6AA0A8A4-17EC-40E0-92FC-1E91D3932219@.microsoft.com...
> > > Am having trouble getting an expression to work that performs a count
on a
> > > different datset within a table. Firstly is this possible. In other
words
> > > table is based on dataset a but i want to have a colum that counts a
field
> > in
> > > dataset b based on criteria. (ie field = 174). Thanks
> >
> >
> >

Tuesday, February 14, 2012

Counting Average Value

i want to count average on one of the fields in my table
i am doing a right click on it and expression and am typing the following
but getting 0 as an answer
=(( Fields!valueactiveaccounts.Value+ Fields!valueskipaccounts.Value)/( Fields!numactiveaccounts.Value+ Fields!numskipaccounts.Value))
is there any other way to get average value?Raj wrote:
> i want to count average on one of the fields in my table
> i am doing a right click on it and expression and am typing the
> following
> but getting 0 as an answer
> =(( Fields!valueactiveaccounts.Value+
> Fields!valueskipaccounts.Value)/( Fields!numactiveaccounts.Value+
> Fields!numskipaccounts.Value))
> is there any other way to get average value?
Try the inbuilt avg aggregate
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_10pz.asp
roland