Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

eliminate negative values in the report

While summing up null values the output should be zero but I am getting negative zero and some garbage values. Please help me how to get rid of such values.

for eg :

value + amount = null + null = -2.387E10

1 Solution

Accepted Solutions
Not applicable
Author

Thanks guys for the replies!!

I resolved it by rounding off the values:

round(value,1) +  round(amount,1)

Its working correctly now.

View solution in original post

9 Replies
salto
Specialist II
Specialist II

Hi,

Before summing up, check if any of the elements is null. In such case, set 0 as the result.

Try something like:

if(not(isnull(Value) and not(isnull(amount),Value+amount,0)) as Result

Hth.

senpradip007
Specialist III
Specialist III

Try like:

Sum(If(Len([Pre-Tax_Value_for_CY])>0,[Pre-Tax_Value_for_CY], 0) + If(Len([Pre-Tax_Value_for_LY])>0,[Pre-Tax_Value_for_LY], 0))

tresesco
MVP
MVP

If the amount and value you mentioned are fields, you could simply use RangeSum(), like:

RangeSum(amount, value)

ashfaq_haseeb
Champion III
Champion III

or you can even use FABS() function.

Regards

ASHFAQ

Not applicable
Author

rangesum and  isnot null is working fine for null values....but while summation is not working for all the scenarios like :

1+-1 =0

instead it is giving 1+ -1 = -2.345E10

Not applicable
Author

fabs doesn't give me correct results

tresesco
MVP
MVP

It could be decimal precision issue. What you see, 1/-1 might be those are actually something with more decimal pionts like:

+/-0.999991211  or so. Load the numeric data and change the number format in the number tab to check the actual value it is being loaded as.

Sokkorn
Master
Master

You may try NumSum(value + amount)

Not applicable
Author

Thanks guys for the replies!!

I resolved it by rounding off the values:

round(value,1) +  round(amount,1)

Its working correctly now.