Greg_Deckler
6 years agoCommunity Champion
Chelsie Eiden's Duration
Chelsie Eiden is my new favorite human being on the face of the planet. I don't know her major but, even if she is majoring in math, it still wouldn't change my mind on this one. That's how much I li...
nigeldavidmaxey
2 years agoRegular Visitor
This was really useful for me to find. I wanted to display elapsed time in readable format in addition to raw value (in hours). I was therefore able to adapt this as shown below to get the desired format:
Formatted Elapsed Time =
// We start with a duration in number of seconds
VAR Duration = SUM(JIRA_DATA_TEAMS[CALCULATED_ELAPSED_MINUTES]) * 60
// There are 86,400 seconds in an day
VAR Days = INT ( Duration / 86400)
// There are 3600 seconds in a hour
VAR Hours = INT ( MOD( Duration - ( Days * 86400 ),86400 ) / 3600)
// Remaining seconds are the remainder of the seconds divided by 60 after subtracting out the hours
VAR Minutes = INT (MOD ( MOD( Duration - ( Days * 86400 ),86400 ), 3600 ) / 60)
VAR DaysText = IF(Days > 0, Days & "d ","")
VAR HoursText = IF(Hours > 0, Hours & "h ","")
VAR MinutesText = IF(Minutes > 0, Minutes & "m ","")
RETURN
// We put the hours, minutes and seconds into the proper "place"
// Days * 10000 + Hours * 100 + Minutes
DaysText & HoursText & MinutesText