# Automatic time calculation

**URL:** <https://forum.dimagi.com/t/automatic-time-calculation/1704>\
**Category:** Users\
**Created:** [April 13, 2014, 2:33pm UTC](https://forum.dimagi.com/t/automatic-time-calculation/1704 "2014-04-13T14:33:23Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![bargolus](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/b/57b2e6/32.png) [@bargolus](https://forum.dimagi.com/u/bargolus)\
**Post date:** [January 30, 2020, 1:28pm UTC](https://forum.dimagi.com/t/automatic-time-calculation/1704/21 "2020-01-30T13:28:13Z")

</div>

Just bumping this one up - I was wondering if anyone had found a work-around?

---

<div class="post-metadata">

**Author:** ![Mazz](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/mazz/32/1004_2.png) [@Mazz](https://forum.dimagi.com/u/Mazz)\
**Post date:** [February 5, 2020, 7:12am UTC](https://forum.dimagi.com/t/automatic-time-calculation/1704/22 "2020-02-05T07:12:10Z")

</div>

Right, so i had a similar issue where i wanted to kind of update times being spent during sessions.  
a coalesce function might do the trick to a saved property, or some other hidden value that only picks up the current time when a specific question is answered.

so 1 hidden value to store time you want to keep, if a question is answered.  
1 hidden value to coalesce the first value, and a blank if the first value is blank.

so one value that's only going to capture the time at a certain condition, and then another value to capture it the first time it does with a coalesce function

i think that should do the trick more or less

[Previous page](https://forum.dimagi.com/t/automatic-time-calculation/1704.md?page=1)
