Calculate Time Differences (eg. Formula for the Age)

Modified on Sun, 16 Mar at 3:12 PM

You can use a dynamic variable to automatically calculate the time difference between two dates. 

For example, you could calculate the age at the time of inclusion (Age at inclusion).

Follow these steps to set it up:

Step 1: Create a Numeric variable

The variable must be of numeric type to perform date calculations.


Step 2: Access the Formula Editor

  • Click on "Edit Formula" at the top right.
  • When asked "Which kind of dynamics?", select "DateDiff (Delay between two dates)".


Step 3: Set the Date Difference Calculation

  • Under "Delay From", select the first date (eg. "Birth date").
  • Under "To", select the second date (eg. "Inclusion date").
  • Under "Expressed in", choose the unit for the time difference: days, months or years


Step 4: Activate the Dynamic Calculation

  • Click the orange message at the top right: "Activate My Dynamics".
  • Check "I understand", then choose: Retrospective Mode (Applies the calculation to all patients in the study)  ± Safe Mode (Also applies to all patients but does not overwrite manually entered values. If the delay was previously calculated and entered manually, it will be preserved).
  • Click "Activate My Dynamics" to finalize.


Your dynamic date calculation is now active! You can verify the results in patient records. 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article