0

Formula for Total Time

What is the proper syntax for adding two time values together?

 

I have table that contains fields for Status, Timestamp and Duration.

 

Status is a text field, Timestamp is a Date/Time field and Duration is a formula field that calculates the difference between consecutive Timestamps.

 

I want to be able to add Durations together based on their Status to determine the total time spent at each Status.

 

Any suggestions?

5 replies

null
    • Nick
    • 4 yrs ago
    • Reported - view

    Maybe something like this:

    Formula field that sums up the duration when the status is "Completed",

     

    sum((select YourTableNameHere)[Status = "Completed"].Duration)

    • Nick
    • 4 yrs ago
    • Reported - view

    or

    let myStatus := Status;
    sum((select YourTableNameHere)[Status = myStatus].Duration)

     

    to view a duration summary for a Status that matches the current record.

    • Avient Specialty Inks
    • Bill.1
    • 4 yrs ago
    • Reported - view

    It's returning a zero value.

     

    I think the issue is that it can't logically sum Duration since it's reading Duration as a string; however, it also doesn't work when I try to convert it to a number using number(Duration), probably because the string is formated to represent time (dd:hh:mm). That's why I innitally asked about how to add time values.

    • Avient Specialty Inks
    • Bill.1
    • 4 yrs ago
    • Reported - view

    This might help illustrate what I'm trying to achieve:

     

    Screen Shot 2019-09-18 at 2.10.40 PM

     

    Each button push creates a record in 'Design Progress' with a Timestamp of "now". The Duration colomn captures the diffence between each Timestamp. To the right of the chart showing the 'Percent Complete' I want to have a series of formula fields that indicate the total amount of time spent at each Status. I just need the proper syntax for adding multple time durations together.

    • Nick
    • 4 yrs ago
    • Reported - view

    In one of my databases that i'm using duration summary, i have the gollowing setup

     

    Screen Shot 2019-09-19 at 11.48.27

     

    I hope it helps...

Content aside

  • 4 yrs agoLast active
  • 5Replies
  • 1915Views