FocalPointQuery: Build a focal point query.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The FocalPointQuery class is used to generate SQL queries for Causata. The data in a focal point query is built around a particular event in a customer profile.

Usage

1
2
3
FocalPointQuery(focalpoint.event, 
  cardinality=if (length(event.attribute)) {"using.all.values"} else {"using.all.events"},
  event.attribute=NULL)

Arguments

focalpoint.event

The event to be used as a focal point.

cardinality

This controls which records are returned when there are multiple events in a profile. The default settings will return one or more records for a profile. See the Details section below.

event.attribute

If supplied, the focal point will be at the time given on this event attribute of the given event.

Details

The FocalPointQuery object builds a focal point query for profile records. A blank FocalPointQuery translates to the following:

"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:

When an event.attribute is specified, then the legal values for this argument and thier meanings are:

Value

A FocalPointQuery object based on the supplied event (and optional event attribute).

Author(s)

David Barker (support@causata.com)

See Also

FocalPointQuery, Connect, WithVariables, Variables, Where, Limit, CausataData.

Examples

1
2
3
4
5
# 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)

Causata documentation built on May 2, 2019, 3:26 a.m.