FocalPointQuery(focalpoint.event, cardinality=if (length(event.attribute)) {"using.all.values"} else {"using.all.events"}, event.attribute=NULL)
"SELECT * FROM Scenarios variable, `focalpoint.event` WHERE variable.focal_point = `focalpoint.event`.timestamp"
This focal point query can be made more specific by adding variables with WithVariables
,
adding where clauses with Where
or setting a row limit with Limit
.
The SQL query can be generated with as.character, e.g. as.character(FocalPointQuery("focalpoint.event"))
.
When a customer event stream is loaded, there may be multple events that match the focal point event and where clauses. In this case one or more profile records (rows) may be returned for a single customer. The cardinality argument defines how which records are output.
When there is no event.attribute specified, the legal values for this argument and their meanings are:
"using.all.events"
For each occurance of the focal point event (that match the where clauses)
there will be a customer record with the timestamp of that event as the focal point.
"using.oldest.event"
When multiple events match the focal point query, the event with the
smallest (oldest) timestamp is used to build the customer record.
"using.newest.event"
When multiple events match the focal point query, the event with the largest
(newest) timestamp is used to build the customer record.
When an event.attribute is specified, then the legal values for this argument and thier meanings are:
"using.all.values"
All values for the attribute on all match focal point events are used
to build customer records, with the value of those attributes as the focal point point for the record.
"using.earliest.value"
The value of the attribute on the event with the smallest
(earliest) timestamp is used as the focal point time.
"using.most.recent.value"
The value of the attribute on the event with the largest
(most recent) timestamp is used as the focal point time.
FocalPointQuery
,
Connect
,
WithVariables
,
Variables
,
Where
,
Limit
,
CausataData
.
# This example builds a query returning a profile at each purchase event
# with a price greater than $30
query <- FocalPointQuery("purchase") + WithVariables(c("some", "variables")) +
Where("purchase-price$Same Session", GreaterThan(30)) + Limit(1000)
as.character(query)
Run the code above in your browser using DataLab