An experienced user asked why the expression <<Calc(<<DRILLDATA.Depth>> + <<DRILLDATA.Length>>)>> only appears to work when there is a Length value in the DRILLDATA table. (The Depth field is required, so it would not be empty.)
ANSWER:
The “Calc” function will always fail if one of the fields in the expression is empty or not a number. This is by design. Let's say you have an expression to calculate the elevation of the bottom of each layer:
<<Calc(<<POINT.Elevation>> - <<PlungeFactor>> * <<LITHOLOGY.Bottom>>)>>
If the Elevation is empty you don't want this expression to return any value – better no value than an incorrect one.
In the cases where you want to treat empty fields as if they contained a zero (0) value, use the "Val" function. "Val" on an empty or non-numeric value returns zero. For numeric values, it merely returns the original value. For the original example, we would revise the expression to:
<<Calc(<<DRILLDATA.Depth>> + <<Val(<<DRILLDATA.Length>>)>>)>>
Because the "Val" function evaluates to a numeric value, if the Length field is empty, the expression will evaluate correctly to whatever value is in the Depth field, by adding 0 to it.