Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
My trip data contains the following:
Trips:
Load TripId
Customer
Vehicle
TripDuration
TripStartTimeDate
TripEndTimeDate
and loads of other fields, the table also links to various other tables, but:
I need to calculate the Total Time Stopped. I was thinking of using the Next TripStartTimeDate - Current TripEndTimeDate to get the answer.
I just cannot get the correct function to use, both Peek() and Previous() looks backwards and there is no Next() function to look forward into the data.
This data needs to be presented by Date, Customer and Vehicle
Hope you can help
But:
Current TripStartTimeDate - Previous TripEndTimeDate
should give you exactly the same result ....
you may for example:
a) add rowno() as id innto first table
b) join with load Current TripStartTimeDate - Previous TripEndTimeDate, row() -1 as id from your table
regards
D
You are in the right path
If you need to calculate the time stopped by vehicle Order your table by date and vehicle then use peek and previous
To evaluate next record to identify the last record of each vehicle by date there is a sample in the community
Search it
When I arrive to my office I can find it for you
Hector garcia
Good look
Sent from my iPhone