<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Property Calculation with a Condition in Tips, Tricks &amp; Best Practices</title>
    <link>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968208#M8752</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been implementing a property onto deals that calculate the number of days the deal has been in a deal stage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a custom formula on a property:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;time_between([properties.date_became_sales_qualified_lead_in_pipeline],[properties.todays_date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add a condition to this to stop the property from updating when it exits the Sales Qualified Lead Stage. At the moment, it continues to count.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 10:12:42 GMT</pubDate>
    <dc:creator>BGreen92</dc:creator>
    <dc:date>2024-04-29T10:12:42Z</dc:date>
    <item>
      <title>Custom Property Calculation with a Condition</title>
      <link>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968208#M8752</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been implementing a property onto deals that calculate the number of days the deal has been in a deal stage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a custom formula on a property:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;time_between([properties.date_became_sales_qualified_lead_in_pipeline],[properties.todays_date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add a condition to this to stop the property from updating when it exits the Sales Qualified Lead Stage. At the moment, it continues to count.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:12:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968208#M8752</guid>
      <dc:creator>BGreen92</dc:creator>
      <dc:date>2024-04-29T10:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Property Calculation with a Condition</title>
      <link>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968408#M8761</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/661309"&gt;@BGreen92&lt;/a&gt;,&lt;BR /&gt;maybe you could try to add an if-condition to your formula. Something like this:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if([properties.lifecyclestage]="salesqualifiedlead")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm not sure if that fully works as the calculated properties always continue to calculate. Another option might be to extract the calculated value into another static property at a time where it's correct (with a "copy property value" workflow action).&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Colin&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 14:47:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968408#M8761</guid>
      <dc:creator>colinwitt</dc:creator>
      <dc:date>2024-04-29T14:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Property Calculation with a Condition</title>
      <link>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968439#M8764</link>
      <description>&lt;P&gt;Thank you, Colin; I have managed to get this to work. I'll post the solution for others just in case they need to achieve a similar scenario.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code that I have used to auto-update a property on a deal, telling me how many days the deal sat in that stage.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(([properties.dealstage] == "1234567"), time_between([properties.date_became_pql],[properties.todays_date]), if((((([properties.dealstage] == "1234568") || ([properties.dealstage] == "12345689")) || ([properties.dealstage] == "12345690")) || ([properties.dealstage] == "12345691")),time_between([properties.date_became_pql],[properties.hs_date_deal_exited_stage])))&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 15:28:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Custom-Property-Calculation-with-a-Condition/m-p/968439#M8764</guid>
      <dc:creator>BGreen92</dc:creator>
      <dc:date>2024-04-29T15:28:43Z</dc:date>
    </item>
  </channel>
</rss>

