Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to calculate Number of Days, hours, minutes, seconds using this code for the attribute named as INC_DURATION_In_Seconds. However; i'm not getting the desired output. It gives me all zeros as in 0 days 00:00:00. What am i doing wrong. Please help.
Code:
Num(Floor(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])) / 86400)) & ' day(s) ' &
If(Floor(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 86400) / 3600) < 10, '0') & Num(Floor(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 86400) / 3600)) & ':' &
If(Floor(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 3600) / 60) < 10, '0') & Num(Floor(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 3600) / 60)) & ':' &
If(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 60) < 10, '0') & Num(Mod(Sum({<[INCIDENTSTATUS] = {'Closed', 'Resolved'}>} Num([INC_DURATION_In_Seconds])), 60))
INC_DURATION_In_Seconds |
95000 |
97822 |
Try this
Num(Floor(Sum({<[INCIDENTSTATUS]={'Closed', 'Resolved'}>} [INC_DURATION_In_Seconds]) / 86400)) & ' day(s) ' &
Text(Floor(Mod(Sum({<[INCIDENTSTATUS]={'Closed', 'Resolved'}>} [INC_DURATION_In_Seconds]), 86400) / 3600), '00') & ':' &
Text(Floor(Mod(Sum({<[INCIDENTSTATUS]={'Closed', 'Resolved'}>} [INC_DURATION_In_Seconds]), 3600) / 60), '00') & ':' &
Text(Mod(Sum({<[INCIDENTSTATUS]={'Closed', 'Resolved'}>} [INC_DURATION_In_Seconds]), 60), '00')
Error in Expression: Text takes 1 parameter
Did you already trying to solve the task with: interval() ?
Yes, that's already been tried. Now, i have tried this one but its not giving me the desired output.
Num(Floor(Sum({<[INCIDENTSTATUS]={'CLOSED', 'RESOLVED'}>} [INC_DURATION_In_Seconds]) / 86400)) & ' day(s) ' &
Num(Floor(Mod(Sum({<[INCIDENTSTATUS]={'CLOSED', 'RESOLVED'}>} [INC_DURATION_In_Seconds]), 86400) / 3600), '00') & ':' &
Num(Floor(Mod(Sum({<[INCIDENTSTATUS]={'CLOSED', 'RESOLVED'}>} [INC_DURATION_In_Seconds]), 3600) / 60), '00') & ':' &
Num(Mod(Sum({<[INCIDENTSTATUS]={'CLOSED', 'RESOLVED'}>} [INC_DURATION_In_Seconds]), 60), '00')
It gives me 0 day(s) :: for the value 95038 seconds
Just give it another trial because it's working with:
interval(95038 / 86400, 'd hh:mm:ss')