Learn R Programming

Causata (version 4.1-0)

Where: Query WHERE clause and comparison operations

Description

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

Usage

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)

Value

  • An object of class Where used for building queries.

tabular

ll

bold

Operation

tab

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

Details

There are three basic usage patterns. These are all equivalent:
  • Where("variable.`variable-name` <> 'string value'")
Where("variable-name", "<> 'string value'") Where("variable-name", NotEqualTo("string value")

See Also

Query, FocalPointQuery.

Examples

Run this code
q <- FocalPointQuery("page-view") + Where("page-view-count", GreaterThan(10))
q <- FocalPointQuery("page-view") + 
     Where("total-spend", LessThanOrEqualTo(100)) + 
     Where("total-spend", GreaterThan(1))

Run the code above in your browser using DataLab