The totaling is working fine but I am getting (0) if there is no "First".
How can I substitute the (0) for "".
=Sum(iif(Fields!Shift_Worked.Value="First",1,0))
Thank you for any suggestions offered
FrankI got a similar problem lately. Try using a report function like :
Public Function IsFirst(tehtext as String) as Integer
If((tehtext ="First")
Return 1
Else
Return 0
End If
End Function
Then use it in your expression like this :
=IIf(Sum(Code.IsFirst(Fields!Shift_Worked.Value) > 0),
Sum(Code.IsFirst(Fields!Shift_Worked.Value), "")
I hope that helps...
"Frank" wrote:
> The totaling is working fine but I am getting (0) if there is no "First".
> How can I substitute the (0) for "".
> =Sum(iif(Fields!Shift_Worked.Value="First",1,0))
> Thank you for any suggestions offered
> Frank
Showing posts with label sum. Show all posts
Showing posts with label sum. Show all posts
Friday, March 9, 2012
Friday, February 17, 2012
doing a sum on a counted field
i have a dataset with a column that has 2 values. YES or NO.
i have to use a textbox inside a filtered(for yes) list that are to get
a count of yes. I have to use another list to do the same for NO.
using--Count(Fields!answer.Value). Now i want to perform a calculation
on the counts and for the life of me i cant do it. Since the txtboxes
are not contained in the same grouping i cannot reference them using
ReportItems!txt.value. Is there something i can change in my sql
statement to break out the counts as their own columns' please helpIn RS you could do a conditional sum using IIF:
=Sum( iif(Fields!answer.Value = "YES", 1, 0))
=Sum( iif(Fields!answer.Value = "NO", 1, 0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"the finger" <m_kosurko@.hotmail.com> wrote in message
news:1115066710.809917.171580@.z14g2000cwz.googlegroups.com...
>i have a dataset with a column that has 2 values. YES or NO.
> i have to use a textbox inside a filtered(for yes) list that are to get
> a count of yes. I have to use another list to do the same for NO.
> using--Count(Fields!answer.Value). Now i want to perform a calculation
> on the counts and for the life of me i cant do it. Since the txtboxes
> are not contained in the same grouping i cannot reference them using
> ReportItems!txt.value. Is there something i can change in my sql
> statement to break out the counts as their own columns' please help
>
i have to use a textbox inside a filtered(for yes) list that are to get
a count of yes. I have to use another list to do the same for NO.
using--Count(Fields!answer.Value). Now i want to perform a calculation
on the counts and for the life of me i cant do it. Since the txtboxes
are not contained in the same grouping i cannot reference them using
ReportItems!txt.value. Is there something i can change in my sql
statement to break out the counts as their own columns' please helpIn RS you could do a conditional sum using IIF:
=Sum( iif(Fields!answer.Value = "YES", 1, 0))
=Sum( iif(Fields!answer.Value = "NO", 1, 0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"the finger" <m_kosurko@.hotmail.com> wrote in message
news:1115066710.809917.171580@.z14g2000cwz.googlegroups.com...
>i have a dataset with a column that has 2 values. YES or NO.
> i have to use a textbox inside a filtered(for yes) list that are to get
> a count of yes. I have to use another list to do the same for NO.
> using--Count(Fields!answer.Value). Now i want to perform a calculation
> on the counts and for the life of me i cant do it. Since the txtboxes
> are not contained in the same grouping i cannot reference them using
> ReportItems!txt.value. Is there something i can change in my sql
> statement to break out the counts as their own columns' please help
>
Subscribe to:
Posts (Atom)