Where: Query WHERE clause and comparison operations

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

Description

The Where function creates a WHERE clause that can be added to Query or FocalPointQuery objects.

Usage

1
Where(variable, operation=NULL)

Arguments

variable

A string matching the name of a Causata variable, or a string representing a SQL WHERE clause, like "variable <> 123".

operation

An operator of class RawOperator, such as GreaterThan(123) or EqualTo(123)

Details

There are three basic usage patterns. These are all equivalent:

The first form is a raw SQL WHERE clause, when using this form, you must correctly reference and escape the variable name, and the value for the operator you choose. The second form is (variable.name, operation). Using this form the variable name will be correctly referenced and escaped. However, the right hand side (the operation) must still be correctly escaped by you. The third form is (variable.name, operation.object). Using this form the variable name and operation are both correctly escaped. The allowable operations in the third form are as follows:

Operation Arguments
BeginningWith Single value
EqualTo Single value
NotEqualTo Single value
GreaterThan Single value
GreaterThanOrEqualTo Single value
LessThan Single value
LessThanOrEqualTo Single value
Like Single value
In One or more comma-separated values

Value

An object of class Where used for building queries.

Author(s)

David Barker (support@causata.com)

See Also

Query, FocalPointQuery.

Examples

1
2
3
4
q <- FocalPointQuery("page-view") + Where("page-view-count", GreaterThan(10))
q <- FocalPointQuery("page-view") + 
     Where("total-spend", LessThanOrEqualTo(100)) + 
     Where("total-spend", GreaterThan(1))

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

Related to Where in Causata...