Use empty cell as zero

Hi All,

 

I need to take the sum of 3 columns. So I usea java Snippet to calculate this and return it in an extra column.

But the column may contain a "?"(empty field in excel). And it is not an option to change the excel sheets.

So when I do the calculation, every time one of the columns is empty, the result column also give a "?".

 

Than I tried to change every empty cell to an 0.(double) but i get an error. This is the code that I use:

if($Double$ == null){
 $Double$ = 0.0;
}

 

And this is the error I get:

WARN Java Snippet (simple) Unable to compile expression

ERROR at line 13

This method must return a result of type java.lang.Double

 

Can anybody help me? Or does someone have a better solution?

 

Thanks!

i use in this case Missing Value node, it seems to work for this problem

 

Greetings

Try something like this:

//You might consider creating this as a method too.
Double d = $Double$
if(d == null){
 d = 0.0;
}
//Use d instead of $Double$.