# Help with custom equation property

**URL:** <https://community.hubspot.com/t/help-with-custom-equation-property/129690>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [April 10, 2025, 2:49pm UTC](https://community.hubspot.com/t/help-with-custom-equation-property/129690 "2025-04-10T14:49:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RDePauw3](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RDePauw3](https://community.hubspot.com/u/RDePauw3)\
**Post date:** [April 10, 2025, 2:49pm UTC](https://community.hubspot.com/t/help-with-custom-equation-property/129690/1 "2025-04-10T14:49:26Z")

</div>

What I currently have:

(([properties.invoice\_sent\_date] - [properties.todays\_date]) - ([properties.customer\_io\_global\_suppression\_date] - [properties.customer\_io\_suppression\_removal\_date]))

This works, however if If “customer\_io\_suppression\_removal\_date” and “customer\_io\_global\_suppression\_date” are unknown, I would like to calculate just (invoice\_sent\_date - todays\_date)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 11, 2025, 3:10am UTC](https://community.hubspot.com/t/help-with-custom-equation-property/129690/2 "2025-04-11T03:10:44Z")

</div>

Hey, @RDePauw3 👋 Welcome to our community! Thanks for the interesting question. I’d like to invite some of our community experts who have experience with calculation properties to the conversation — @Josh @louischausse @HFisher7 have you built anything similar recently?

Thank you very much! — Jaycee

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [April 11, 2025, 1:05pm UTC](https://community.hubspot.com/t/help-with-custom-equation-property/129690/3 "2025-04-11T13:05:52Z")

</div>

Calcuation fields allows the is\_known and if functions. So you can run an if statement to check if those two fields are known and then output what you want for true and false conditions.

```lia-code-sample
if ( is_known([properties.customer_io_suppression_removal_date]) && is_known([properties.customer_io_global_suppression_date]), 
(([properties.invoice_sent_date] - [properties.todays_date]) - ([properties.customer_io_global_suppression_date] - [properties.customer_io_suppression_removal_date])), 
([properties.invoice_sent_date] - [properties.todays_date]))

```

Breaking down the formula above should be (trying to make it easier to read):

IF

is\_known([properties.customer\_io\_suppression\_removal\_date]) && is\_known([properties.customer\_io\_global\_suppression\_date])

TRUE:

(

([properties.invoice\_sent\_date] - [properties.todays\_date]) - ([properties.customer\_io\_global\_suppression\_date] - [properties.customer\_io\_suppression\_removal\_date])

)

FALSE:  
([properties.invoice\_sent\_date] - [properties.todays\_date]))

---

<div class="post-metadata">

**Author:** ![RDePauw3](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RDePauw3](https://community.hubspot.com/u/RDePauw3)\
**Post date:** [April 11, 2025, 1:13pm UTC](https://community.hubspot.com/t/help-with-custom-equation-property/129690/4 "2025-04-11T13:13:23Z")

</div>

After some tinkering I finally got this to work:

if((is\_known([properties.customer\_io\_global\_suppression\_date]) && is\_known([properties.customer\_io\_suppression\_removal\_date])), (time\_between([properties.invoice\_sent\_date], [properties.todays\_date]) - time\_between([properties.customer\_io\_global\_suppression\_date], [properties.customer\_io\_suppression\_removal\_date])), time\_between([properties.invoice\_sent\_date], [properties.todays\_date]))
