Calculation Property Doesn't Work if a Property is Blank

In case anyone stumbles upon this like I did - I also couldn’t get this to work and instead used workflows to set the default property to 0.

At first: big shame on Hubspot that the paying users have to find workarounds for problems like this - problems, that appeared already years ago.

At second: in my opinion the easiest solution is to use a workflow and the funktion

“Increase or decrease property” and increase the value by 0, because unknown + 0 = 0

Best,

Florian

Alternative solution without using a workflow: Use Advanced Mode in the Calculation Property and combine if and is_present function before adding the properties:

(if(is_present([properties.xy]), [properties.xy], 0) +

Under-rated comment here - this is the best solution!

This works a treat for calculations that require you to calculate with other calculations/rollups where you can’t set the default value to 0, and should be marked as the solution. No longer need workflows.

I couldn’t use `is_present` for some reason. I wound up setting the unknown values to 0 within the formaul like:

if(is_known([properties.abc]),[properties.abc], 0) + if(is_known([properties.xyz]),[properties.xyz], 0)

So we’re saying that if the NUMBER property has a value, use that vlaue in the calculation. If there’s no value, call it 0 and calculate accordingly.
That worked like a charm for me after a little trial and error :grinning_face:

Yup, HubSpot changed the is_present function to is_known (presumably to align with the terminology they use in filters)!

This is a much better solution when compared to using workflows to zero fields if they are unknown. Workflows like this saturate the activity history of a record and should be avoided wherever possible to ensure only required workflows are triggered on records.

This is the best answer here and it helped me. Using this, I was able to get a working version that prefills all contacts with a value.
I’ll provide my code here. Maybe the context will help someone else.
First it checks to make sure the fields exist. If either one is missing, the formula returns “no” and that is updated o nthe contact record. If they both exist, the formula proceeds to evaluating if one date is greater than (after) the other.

if (

is_known( date1 ),

if(

is_known( date2 ),

if(

date1 > date2,

“Yes”,

“No”

),

“No”

),

“No”

)
We had to do this because you cannot filter based on one date property being before or after another date property. So this calculation allows us to select it in report filtering. An absurd work around, but it works.

Definitely still need an option to formulate within a calucation field if property is null or blank. All the above responses did not work for me & my Custom string if statement equation; Other than a workflow. My field is not important enough to warrant yet another workflow. That’s what the calculated fields were supposed to help eliminate…

I ran into this issue today, and you first want to check the property for a value using is_known.
If you share what you are trying to calculate, I can help provide a little more assistance