CMS Development

hyoung22
Participant

Formula that returns a string based on date period

I received a request that we be able to report on leads by created date and group them into budget periods. For example leads created between 8/16/22-8/16/23 should populate as "2023 Budget" 

 

I created this formula below but have 1 lingering expression error.

 

IF(
DATEPART("MONTH",[properties.createdate]>=8) && DATEPART("DAY",[properties.createdate])>=16,
CONCAT(TEXT(YEAR([properties.createdate]+1)))," Budget",
CONCAT(TEXT(YEAR([properties.createdate])))," Budget",
)

 

This is my first foray into Hubspot formulas and the knowledge base is not in one place. Can anyone point me in the right direction on what this error could be or, even better, the solution.😎

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Formula that returns a string based on date period

Hey, @hyoung22 👋 Did you get this resolved?

 

  • Can you share the specific error? Both adding the error message here as a reply + screenshots may be helpful to our community
  • For context, are you creating calculation property in-app or via the Properties API?

 

Best,

Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
AlyCarroll
Participant | Platinum Partner
Participant | Platinum Partner

Formula that returns a string based on date period

I think we are having a similar issue with different context. We are trying to create a field that will show the # of days the deal has been open. If it's closed won or lost, it should reference the created date and close date. If it's still open, it should reference a property we created for "Today's Date" and created date. However, there is an "expression error" with our formula.

 

=if([properties.hs_is_closed]=TRUE,[properties.closedate]-[properties.createdate],[properties.today_s_date]-[properties.createdate])

 

(not shown in the screenshot, the number format is "Formated Number")

AlyCarroll_0-1699642136483.png

 

0 Upvotes