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

Subtract Null - Value


Hi

I have a scenario , whre i have to subtract the null value with the value.

Pls find the attached file...

Thanks

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

For arithmetic operations on NULL values, you should always use the Range functions. Hence, to calculate the difference between two fields, you should use:

     Sum( RangeSum( A, -B ) )

A conditional expression like e.g. If(IsNull( A ), .... ) will always take longer time to evaluate.

HIC

View solution in original post

5 Replies
its_anandrjs

Now check i forget some thing before

Try this way in expression

=Sum( if( len(A) = 0,0,A)  - B)

=Sum(B - if( len(A) = 0,0,A) )

amit_saini
Master III
Master III

Senthil,

Please see the attachment.

Thanks,

AS

hic
Former Employee
Former Employee

For arithmetic operations on NULL values, you should always use the Range functions. Hence, to calculate the difference between two fields, you should use:

     Sum( RangeSum( A, -B ) )

A conditional expression like e.g. If(IsNull( A ), .... ) will always take longer time to evaluate.

HIC

SunilChauhan
Champion
Champion

Sum( if( isnull(A) ,0,A)  - sum(B)

Sunil Chauhan
Not applicable
Author

Hi,

Hope you are looking for the below result.

Capture.PNG.png

Please check the attched file for the same.