When you're collecting date or time-related information on your forms, sometimes it would be nice to be able to calculate the difference between two dates, or datetimes. Using a Custom Formula, you can tell Youreka to calculate the time difference in Years, Months, Days, Hours, Minutes, or Seconds.
How To Configure Date Formulas
From the form template builder,
- Add questions to your template for start and end. Both questions should be the same type (date or datetime). They can be standard or field link questions.
- Add a third question to store the calculated difference. This question must be a number question and can be a standard or field link question.
- Select the Custom Formula tab.
- Select Math (+, -, /, *).
- Select Dates.
- Select the Question type of your start and end questions from step 1.
- Select the Section and Question for your start and end questions.
- Select the Date Unit you wish the calculation to save as (Years, Months, Days, Hours, Minutes, or Seconds).
- To calculate the difference between two date or datetime questions, their types must match. They must both be date questions or they must both be datetime questions.
- The question containing the formula must be a number question. The units will be defined in the custom formula.
- Time zone differences and Daylight Savings are not considered when calculating the formula.
- For date formulas inside of linked sections, only dates within the same linked section or within standard sections can be picked.
- For date formulas in standard sections, only dates in standard sections may be chosen.
- A formula can exist as a simple question in a form template or as a field link. In the event of the latter, the final calculation would be saved to the appropriate field in Salesforce.