Showing posts with label budget. Show all posts
Showing posts with label budget. Show all posts

Wednesday, March 7, 2012

divide by infinity

help... I have a field called PercentVar_P4 which really is budget - actuals... I need to create an expression that will that the

PercentVar_P4/budget.. when I do I get Infinity and nan... I want to see the negative number.. I have read through all the blogs and nothing seems to fit..

Please HELP!!

Did you look at the following blog article? http://blogs.msdn.com/bwelcker/archive/2006/09/26/End-of-Amnesia-_2800_Avoiding-Divide-By-Zero-Errors_2900_.aspx

-- Robert

Divide By 0

I am having some issues with expressions as I am attempting to perform the
following:
iif(budget=0,0,actual/budget)
it seems that regardless of the expression all clauses are evaluated.
The actual expression is as follows:
=iif( Sum(Fields!BudgetMTD.Value, "DepartmentDetGrp")=0,0,
Sum(Fields!ActualMTD.Value, "DepartmentDetGrp")/ Sum(Fields!BudgetMTD.Value,
"DepartmentDetGrp"))
Any suggestions to get around this?IIF is a function call which evaluates all arguments - hence the division by
zero.
Change the call to use the following pattern to avoid the issue:
=IIF(budget=0, 0, actual / IIF(budget = 0, 1, budget))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"David Fuller" <DavidFuller@.discussions.microsoft.com> wrote in message
news:14E1BFB1-3D84-449F-819C-3C1C5DBD9288@.microsoft.com...
>I am having some issues with expressions as I am attempting to perform the
> following:
> iif(budget=0,0,actual/budget)
> it seems that regardless of the expression all clauses are evaluated.
> The actual expression is as follows:
> =iif( Sum(Fields!BudgetMTD.Value, "DepartmentDetGrp")=0,0,
> Sum(Fields!ActualMTD.Value, "DepartmentDetGrp")/
> Sum(Fields!BudgetMTD.Value,
> "DepartmentDetGrp"))
> Any suggestions to get around this?