Forum Discussion
pho30
Jun 13, 2018Copper Contributor
Calculate Difference on Time
Hi All, Is there a way to calculate difference between 2 times to show for example how many days between the first and second value? The image below provides the results and ideally I'd have ...
- Jun 15, 2018
You could try this approach:
datatable (Date1:datetime, Date2:datetime)[datetime(2018-06-11 10:05:00), datetime(2018-06-11 11:05:00),datetime(2018-06-11 10:05:00), datetime(2018-06-12 11:05:00),datetime(2018-06-11 10:05:00), datetime(2018-06-13 14:05:00),datetime(2018-06-11 10:05:00), datetime(2018-06-15 09:05:00)]| project Diff=format_timespan(Date2-Date1,"d"), Date1, Date2
Emilian Ertel
Jun 15, 2018Brass Contributor
You could try this approach:
datatable (Date1:datetime, Date2:datetime)
[
datetime(2018-06-11 10:05:00), datetime(2018-06-11 11:05:00),
datetime(2018-06-11 10:05:00), datetime(2018-06-12 11:05:00),
datetime(2018-06-11 10:05:00), datetime(2018-06-13 14:05:00),
datetime(2018-06-11 10:05:00), datetime(2018-06-15 09:05:00)
]
| project Diff=format_timespan(Date2-Date1,"d"), Date1, Date2
pho30
Jun 15, 2018Copper Contributor
Exactly what I was looking for, much appreciated!