Wednesday, March 7, 2012

Help - Problem with an Expresion

I have Created an expression
= Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value
Works fine but Net_Revenue.value is created from Sales Volume * Purchase
Price and if no Sales Volume then the default will be zero.
If the formula tries to divide by a zero I get an -infinity error on the
report.
Tried = IF Fields!Sale_Volume.Value = 0 then 0 ELSE
Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value END IF
but I must be doing something wrong as it returns an error, anyone have any
ideas?Hi Kevin,
Try
= IIF(Fields!Sale_Volume.Value = 0, 0, Fields!Net_revenue.Value/
Fields!Gross_Revenue.Value)
--
Rodney Landrum
Author, "Pro SQL Server Reporting Services" (Apress)
http://www.apress.com
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:7899967B-6164-4272-8D12-4421AC8E05F0@.microsoft.com...
>I have Created an expression
> = Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value
> Works fine but Net_Revenue.value is created from Sales Volume * Purchase
> Price and if no Sales Volume then the default will be zero.
> If the formula tries to divide by a zero I get an -infinity error on the
> report.
> Tried = IF Fields!Sale_Volume.Value = 0 then 0 ELSE
> Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value END IF
> but I must be doing something wrong as it returns an error, anyone have
> any
> ideas?|||Thanks Rodney, that works.
Nearly got it right :)
"Rodney Landrum" wrote:
> Hi Kevin,
> Try
> = IIF(Fields!Sale_Volume.Value = 0, 0, Fields!Net_revenue.Value/
> Fields!Gross_Revenue.Value)
> --
> Rodney Landrum
> Author, "Pro SQL Server Reporting Services" (Apress)
> http://www.apress.com
> "Kevin" <Kevin@.discussions.microsoft.com> wrote in message
> news:7899967B-6164-4272-8D12-4421AC8E05F0@.microsoft.com...
> >I have Created an expression
> >
> > = Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value
> >
> > Works fine but Net_Revenue.value is created from Sales Volume * Purchase
> > Price and if no Sales Volume then the default will be zero.
> >
> > If the formula tries to divide by a zero I get an -infinity error on the
> > report.
> >
> > Tried = IF Fields!Sale_Volume.Value = 0 then 0 ELSE
> > Fields!Net_revenue.Value/ Fields!Gross_Revenue.Value END IF
> >
> > but I must be doing something wrong as it returns an error, anyone have
> > any
> > ideas?
>
>

No comments:

Post a Comment