Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have columns like [start time], [end time], so i have to 'spent time'
for eg: data is like below. here total time has to calculate only if [start time]and [finish time] available
Start time | Finish time |
02:45:23 | 03:10:15 |
06:26:00 | |
12:57:54 | |
15:09:12 | 17:40:39 |
if(not isnull([Start time]) and not isnull([Finish time]),[Finish time]-[Start time]) as spent time
i used below condition but its throwing error like expected ")" can you please correct of anything wrong
if(not IsNull(Timestamp#([Time Finished],'YYYY-MM-DD hh:mm:ss.fff'))- not IsNull(Timestamp#([Time Started],'YYYY-MM-DD hh:mm:ss.fff')), ('YYYY-MM-DD hh:mm:ss.fff')) as Duration
Started Time | Finished Time |
2023-01-03T02:45:23Z | 2023-01-03T02:49:23Z |
2023-01-03T06:26:00Z | |
2023-01-03T12:57:54Z | |
2023-01-03T15:09:12Z | 2023-01-03T17:40:57Z |
if(not IsNull([Time Finished]) and not IsNull([Time Started]),
Timestamp#([Time Finished]-[Time Started],'YYYY-MM-DD hh:mm:ss.fff')
,'YYYY-MM-DD hh:mm:ss.fff') as Duration
it is not coming correctly, if [Time Finished] column is empty it has to show as empty only, and duration format is coming like below.
the expected result is like for example in the above table the Duration should come as 00:04:00
if(not IsNull([Time Finished]) and not IsNull([Time Started]), ([Time Finished]-[Time Started])) as Duration
if this does not show in the format you require you can add the timestamp expression