Skip to content

Latest Queries

Latest

Returns the most recent past value for a given feature

Syntax:

Latest(feature
       [by feature(s)]
       [where condition]
       [after time]
       [last duration])

Code Examples:

Latest(ip by user where successful)
Latest(user by ip, user_agent last 10 minutes)
Latest(sku by account where price > 2000 after latest_billing_change)

Data Example:

_time user ip Latest(ip by user) Latest(ip by user last hour)
9:40AM anna 1.1.1.1 null null
10:20AM brad 2.2.2.2 null null
11:00AM anna 3.3.3.3 1.1.1.1 null
11:40AM anna 1.1.1.1 3.3.3.3 3.3.3.3
12:20PM anna 4.4.4.4 1.1.1.1 1.1.1.1

LatestTime

Returns the most recent past event time for the given clauses

Syntax:

LatestTime([by feature(s)]
           [where condition]
           [after time]
           [last duration])

Code Examples:

LatestTime(by user where successful)
LatestTime(by ip, user_agent last 10 minutes)
LatestTime(by account where price > 2000 after latest_billing_change)

Data Example:

_time user LatestTime(by user) LatestTime(by user last hour)
9:40AM anna null null
10:20AM brad null null
11:00AM anna 9:40AM null
11:40AM anna 11:00AM 11:00AM
12:20PM anna 11:40AM 11:40AM