We have a piece of equipment that we’re trying to track while it’s in operation. We have a “Start” and “Stop” action to capture respective timestamps, and a “Total Time” column to calculate total run time.
The equipment can run multiple times a day with variable amount of stops, so we want to be able to hit “Start/Stop” multiple time with the “Total Time” column updating with the actual time the equipment was running.
Is this possible without adding dozens of “Total Time” columns for each occurrence?..
@Dialect_Junk
You can set a [START] column (Type: Time) and [CHANGE TIMESTAMP] column (Type: Change Timestamp). Bind this [CHANGE TIMESTAMP] column to watch any column data change you want. Than your you can calculate your [TOTAL TIME] column with an expression i.e.
TIME([CHANGE TIMESTAMP]) - [START]
Will this provide a running total to the [Total Time] column?
Say that today I have 2 sets of start/end times for my equipment:
I hit “Start” at 9am, “End” at 11am for 2 hours.
I hit “Start” at 2pm, “End” at 6pm for 4 hours.
Will my [Total Time] update to 6 hours?
@Dialect_Junk
You can do it this way:
You have [START]
and [END]
columns. Create 2 actions which will record a datetime stamp to these columns with Data: change a value of a column & use NOW()
as a value.
Create 2 Virtual Columns in your table:
(1) STEP_TOTAL with an expression of TIME([END]) - TIME([START])
(2) TOTAL with an expression of [TOTAL] + [STEP_TOTAL]
Levent, thanks for the suggestion. I gave that I try but the Virtual Column [TOTAL] is adding my [Total Time] column to the [STEP_TOTAL] column, essentially just doubling my [Total Time] column. I’m sure I’m missing something…
This was interesting request from Mr @LeventK so I made a small sample app how you can do that. It will calculate total as minutes. The app name is “IN and OUT” and you can find it from here… https://www.appsheet.com/portfolio/531778
Thank you, both!
User | Count |
---|---|
43 | |
28 | |
24 | |
24 | |
13 |