Showing posts with label substitute. Show all posts
Showing posts with label substitute. Show all posts

Friday, March 9, 2012

Don't want to show any zeros

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=iif(
Sum(iif(Fields!Shift_Worked.Value="First",1,0)) > 0,
Sum(iif(Fields!Shift_Worked.Value="First",1,0)),
""
)
"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
>|||Jimbo,
Thank you very much, it works great.
"Jimbo" wrote:
> =iif(
> Sum(iif(Fields!Shift_Worked.Value="First",1,0)) > 0,
> Sum(iif(Fields!Shift_Worked.Value="First",1,0)),
> ""
> )
>
> "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
> >

Don't want to show (0) when running =Sum(iif

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