Skip to main content
Active Contributor I
February 19, 2024
Solved

Calculating Age

  • February 19, 2024
  • 2 replies
  • 413 views

Hello All

I’ve been reading a few articles around this topic, but still unclear.

If I’m collecting date of birth, can I create an automated flow based on their age? I’m sure I can create one based on the current date, but ts there a way for Klaviyo to calculate their age and input them into the flow once they qualify for that age?

Thanks!

    This topic has been closed for replies.
    Best answer by DavidV

    Hi @jtao23,

    It sounds like you’re trying to create filters based on age groups - so for example, if you’re 31-40, send this email on their birthday, if you’re 41-50, send them down this pathway etc.

    If that’s what you’re trying to do, one way you could approach this without having to write code would be to CSV export the segment of customers for whom you have a DOB. In Excel or Google Sheets you could use the formula:

    =YEAR(TODAY())-YEAR(XX)

    where XX = the cell of the original value (ie. A1). Then you drag down the list to apply to all of the rest of the list.

    From here you can now import a new custom property and let’s say you call this “2024 Age”, and use for the remainder of this year the flow filter based on 2024 age.

     

    It’s a little hacky but this should at least do the job for the year if that’s what you’re trying to do! You could also call on this age inside a template ie. 

    We understand that you are {{ person|lookup:'2024 Age'|default:'very young' }} today! Happy Birthday! 

    Hope that helps!

     

    Thanks
    David

    2 replies

    Taylor Tarpley
    Community Manager
    Community Manager
    February 22, 2024

    Hi there @jtao23

     

    Thanks for sharing your question with us! Happy to help! 

     

    Yes, you can definitely create a birthday flow with the date property collected and use a date triggered flow for this. If you wanted to show exactly what age a customer would be in a birthday flow, this would require some custom coding. I’d encourage you to configure this within the template itself as I do not believe this calculation work could be used as a trigger filter. 

     

    Do you mind sharing your overall goal of the flow and the message so we can best understand if we can accomplish this and how? For instance what do you mean by ‘qualify for that age’?

     

    Thank you! 

    -Taylor 

    DavidV
    Partner - Platinum
    DavidVAnswer
    2025 Champion
    February 22, 2024

    Hi @jtao23,

    It sounds like you’re trying to create filters based on age groups - so for example, if you’re 31-40, send this email on their birthday, if you’re 41-50, send them down this pathway etc.

    If that’s what you’re trying to do, one way you could approach this without having to write code would be to CSV export the segment of customers for whom you have a DOB. In Excel or Google Sheets you could use the formula:

    =YEAR(TODAY())-YEAR(XX)

    where XX = the cell of the original value (ie. A1). Then you drag down the list to apply to all of the rest of the list.

    From here you can now import a new custom property and let’s say you call this “2024 Age”, and use for the remainder of this year the flow filter based on 2024 age.

     

    It’s a little hacky but this should at least do the job for the year if that’s what you’re trying to do! You could also call on this age inside a template ie. 

    We understand that you are {{ person|lookup:'2024 Age'|default:'very young' }} today! Happy Birthday! 

    Hope that helps!

     

    Thanks
    David

    Zyber is New Zealand's leading Shopify Premier & Klaviyo Master Platinum Partner passionate about helping merchants succeed. www.zyber.co.nz & www.unlocked.co.nz