cancel
Showing results for 
Search instead for 
Did you mean: 

Feature Request: Allow formatting for DURATION functions in SIGNAL

anna_henke
Explorer
171

Hi,

currently there is a default formatting applied for the return of DURATION functions in SIGNAL. We would like to request an additional parameter that allows to format the output.

To give an example where this is necessary: When e.g. summing up weekdays, there are scenarios where we also want the result to be displayed in days, even when the sum is greater than 7. Currently we get a result of e.g. 1 week, which suggests a different duration than 7 weekdays. 

Thank you,

Anna

 

View Entire Topic
JessicaK
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Anna, 

today's release will bring a more fine granular representation of the duration values, even down to the millisecond. 

As suggested by Sam Gosling, the function DURATION_TO_DAYS or DURATION_TO_MILLISECONDS can be used.

 

SELECT

DURATION_TO_DAYS(

AVG (((

SELECT LAST (END_TIME) - FIRST (END_TIME)

)))

)  AS "Cycle time"

FROM THIS_PROCESS

 

This will result in a float number. However, this will basically just aggregate the milliseconds of the duration to days ( 123 Milliseconds / (1000 * 60 * 60 * 24)). Therefore, weekends won't be deducted here. If this is the requirement, the calculation would look more complex. 

Best regards

Jessica