Time duration

Hi!

I'm trying to calculate the duration of my yoga sessions. I have four columns for this operation:

- Yoga Start of Enum type with just one value: Start

-Yoga Stop of Enum type with just one value: Stop

- Virtual time column Yogasana IN with the calculated value: IF([YOGASANA START]="START", TIMENOW(), 00:00:00)

- Virtual time column Yogasana OUT with the calculated value: IF([YOGASANA STOP]="STOP", TIMENOW(), 00:00:00)

- Duration column Yogasana DURATION with calculated value: IF(ISBLANK([YOGASANA OUT]), "000:00:00", [YOGASANA OUT]-[YOGASANA IN])

The idea is that when I press the START button in the Form view, Yogasana IN is populated with the current time and so is the Yogasana OUT when the STOP button is activated. Upon this, in the field of Yogasana DURATION, there is a difference (OUT-IN) i.e. the duration of the session.

The problem is the following: when the START button is activated, I indeed get the current time (in the field Yogasana IN) but when the STOP button is activated I also get the current time ( in the field Yogasana OUT) but the time in the Yogasana IN get changed as well (although Yogasana IN and Yogasana OUT are not linked with any formula) resulting in the duration of 00:00:00.

What is going on?

Any help or clarification is much appreciated!

PS

OK, I just realized that the formula in Yogasana Duration is causing this, but why I don't know. When the formula is deleted, the activation of the STOP button doesn't change the time in the Yogasana IN field but only in the Yogasana OUT field as planned. However, I now have a problem how to calculate the difference between OUT and IN.

 

 

0 4 63
4 REPLIES 4

I just make a test and it's ok.

my table chrono have and id, start as enum "start", end as enum "end", begin as time and no default value, end as time and no default value, and finally duration as duration wich computed as [end]-[begin]

i have a detail form with [start] and [stop] are quick edit colum.

and to finish i have a bot triggered on update only wich update 

begin with this formula : if(isnotblank([start]),if(isblank([begin]),now(),[begin]),"")

end with this formula : if(isnotblank([stop]),if(isblank([end]),now(),[end]),"")


1) Perhaps I'm sidestepping your question here, but wouldn't it be better to have "Start" and "Stop" be actions instead of dummy enum columns?

2) In your current method, if your start enum is still set, it sort of makes sense that the time resets on the next update, so maybe you need to specify IF(and([YOGASANA START]="START", isblank([YOGASANA STOP]),... so your system understands that Start values only calculate if stop isn't in play yet.

Thank you both for replying in such a short notice!

In the end, I resolved this by changing the YOGA START and YOGA STOP columns to Time type and relying on the time picker to record the current time. With this, the Yogasana duration column with a simple YOGA STOP-YOGA START formula gives the difference I was looking for.

Top Labels in this Space