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

Summing a field when there's a null value in one of the records

Is there a setting I can change to treat nulls as a zero in calculations found in my scripts?

I've used           if(isnull(field1)=0,field1,0)

However it tends to make my script run longer.

I've just seen Alt(field1,0) method and plan on testing it out.

Are there any other ways to have the script interpret a field as zero with minimal impact to load times?

I'd prefer to simply used a SET statement and have QV simply interpret nulls as zeros however I haven't seen anything like this.

2 Replies
swuehl
MVP
MVP

You could look into NullAsValue script statement and NullValue variable:

NullAsValue field1;

Set NullValue='0';

cesaraccardi
Specialist
Specialist

Hi,


Have you tried to run this way?

if(isnull(field1),0,field1)

Regards,

Cesar.