Calculation Property Doesn't Work if a Property is Blank
SOLVE
Hello,
Currently, we have the enterprise level HubSpot account and have been working on creating calculation properties to add together transactional pieces. There is a major roadblock with this property as it doesn't allow a calculation formula to run if there is a blank property. Is there any sort of workaround for this problem?
Calculation Property Doesn't Work if a Property is Blank
SOLVE
Alternative solution without using a workflow: Use Advanced Mode in the Calculation Property and combine if and is_present function before adding the properties:
Calculation Property Doesn't Work if a Property is Blank
SOLVE
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.
Calculation Property Doesn't Work if a Property is Blank
SOLVE
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....
Calculation Property Doesn't Work if a Property is Blank
SOLVE
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.
Calculation Property Doesn't Work if a Property is Blank
SOLVE
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.
Calculation Property Doesn't Work if a Property is Blank
SOLVE
Alternative solution without using a workflow: Use Advanced Mode in the Calculation Property and combine if and is_present function before adding the properties:
Calculation Property Doesn't Work if a Property is Blank
SOLVE
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.
Calculation Property Doesn't Work if a Property is Blank
SOLVE
Hi @MHill4 Thanks for this workaround. Could you maybe share a screenshot of your solution? I cannot get it to work myself - if I multiply an unknown value times 1, I still get unknown, not 0...
Calculation Property Doesn't Work if a Property is Blank
SOLVE
Sorry, by Constant 1, I just meant the number 1.
In the calculation property A for example, your formula would be: (Property A x 1)
That way unknowns for Property A stay unknown, but you can still include those in calculations as 0.
So for @GiantVoices example above. You would make a new calculation property for each of the properties in the proposed formula. For example "2015 Q1 Payment Amount Calc," which would equal (2015 Q1 Payment Amount x 1).
For records with unknown 2015 Q1 Payment Amount, 2015 Q1 Payment Amount Calc = 0
For records with a number entered in 2015 Q1 Payment Amount, 2015 Q1Payment Amount = the same number.
Calculation Property Doesn't Work if a Property is Blank
SOLVE
Hi All,
I believe I may have found a solution to this issue. A bit of effort upfront, but it definitely works!
Lets say: Property A + Property B + Property C = Calculation Property X
For each of Property A, B and C, just create a new calculation property, maybe labeled "Property A Calc", where you do (Property A x Constant 1) = Property A Calc. If Property A is blank, the Property A Calc property will be 0. If Property A is known, Property A Calc = Property A.
So then to get Calculation Property X, you would just do Property A Calc + Property B Calc + Property C Calc. Then it runs perfectly! AND you don't need to do any workflows and you maintain the blank status of the original field which is important!
Calculation Property Doesn't Work if a Property is Blank
SOLVE
I've built workflows that set the property to 0 if unkown but then the problem is if you have a calculation property that references another calculation, there's no way of getting the second calculation to work if all of the criteria are not met. Pretty frustrating.
I'm running into this exact issue now - Is there a best practice to set multiple default values to zero in a single workflow, or did you have to create multiple workflows to set multiple default values?