Age-based reporting is a common requirement when analyzing participant data. In Impact Hub, age is not stored as a static value. Instead, you calculate age using date fields (such as Date of Birth) and custom calculated fields in Builder.
This article provides example approaches you can use to calculate age in years or months, group participants into age ranges, or derive milestone dates like a participant’s 18th birthday.
Important things to know
Age calculations are created as calculated fields within a report.
Calculations do not change the underlying dataset or Apricot data.
You must update field names in examples to match your dataset.
Age calculations depend on valid date fields, such as Date of Birth.
Calculations can return numeric, string, or date values depending on how they’re written.
Only Impact Hub Authors and Author Pro users can create these calculations.
Choose the right age calculation approach
Before creating a calculation, decide what you need to report:
Current age (based on today’s date)
Age as of a specific date (such as enrollment date or a reporting cutoff)
Age ranges (for grouping or charts)
Age in months (commonly used for infants or young children)
Milestone dates (such as a participant’s 18th birthday)
Different reporting needs call for different calculation patterns.
Return a participant’s current age
Simple year-based age (approximate)
Use this approach when you need an approximate age in years for grouping or filtering.
Output type: Numeric
Common uses: Filters, age bands, summary tables
This method uses year-based logic and is suitable when exact precision is not required.
Approximate age using days (more precise)
Use this approach when you want slightly more precision by calculating age using days.
Output type: Numeric
Common uses: KPIs, tables, comparisons
This method divides the number of days since birth by an average year length.
Calculate age as of a specific date
Sometimes you need age based on a fixed point in time rather than “today.”
Common use cases include:
Eligibility checks
Grant or funder reporting
Historical analysis tied to a reporting period
Instead of using now(), reference a specific date field (such as enrollment start date) or a fixed date value.
Group participants into age ranges
Age ranges make dashboards easier to read and interpret.
This approach assumes you already have a numeric age field and uses a conditional calculation to assign participants to labeled groups, such as:
Under 18
18–29
30–39
40–49
50–64
65 and over
Output type: String
Common uses: Bar charts, legends, filters
Identify age in months for children under one year
For infant reporting, age in months is often more meaningful than age in years.
You can:
Calculate age in months as a numeric value
Limit the calculation to children under one year
Display age in months as text for readability
A common pattern is to display:
Age in months for participants under one year
Age in years for all other participants
This creates a single, readable display field.
Return the date of a participant’s 18th birthday
Some reporting scenarios require milestone dates rather than age values.
You can calculate a participant’s 18th birthday as a date field, which is useful for:
Eligibility checks
Compliance timelines
Filters or comparisons
Note: For participants born on February 29, calculations in non-leap years return February 28.
Tips for working with age calculations
Test age calculations in a table visual before using them in charts.
Use numeric age values for filtering and aggregation.
Use string-based age groupings for labels and legends.
Be explicit about whether age is calculated as of today or a specific date.
Expect small differences when using approximate month or year conversions.
Troubleshooting tips
If age calculations don’t behave as expected, check the following:
Does the dataset include a valid Date of Birth field?
Are date fields stored as date values (not text)?
Are field names referenced exactly as shown in the Fields list?
Is now() appropriate for your reporting context?
Do calculated ages match expected values for known records?
Do filters behave correctly when applied to age fields?