Apr 09, 2018 10:19 AM
Here’s the aim.
We have a marina we’re managing. There are numerous “Slips” that “Customers” are referenced in as such:
A1 = John Doe
A2 = Jane Doe
etc.
We have a crew that goes out a few times a day, and logs if the boat that is supposed to be in the slip is there or not.
I’m trying to set it up so the crew’s information is as up-to-date as possible, and end up with a report the coast guard could look at to see when boats were in, or not in, their proper slip.
Very open to ideas.
Apr 09, 2018 12:30 PM
Off the top of my head, I’d say track the transitions.
[Slips]
, containing info on the boat, owner, contact, payment, whatever.[Status]
.[Status]
record contains a timestamp (probably generated from CREATED_TIME()
) and a {Status}
of OUT
or IN
.[Status]
record contains {InTime}
and {OutTime}
that duplicates {Time}
according to {Status}
.[Slip]
record contains a {Latest}
, {LatestIn}
, and {LatestOut}
rollup fields that roll up {Status::Time}
, {Status::InTime}
, and {Status::OutTime}
, respectively, with aggregation functions of MAX(values)
.[Status]
record with Status}
set accordingly.){Latest}
= {LatestOut}
, {Slip::Status}
= 'Out'
; otherwise {Slip::Status}
= 'In'
.This gives you an accurate snapshot of the marina at the granularity of the interval between surveys.
By listing all [Status]
records for a slip, you can produce a history of slip transitions.
Demonstration base here.
Apr 10, 2018 06:31 AM
This is great, thank you!