there is at least one (object)

This construct tests whether there is at least one object of a given type in the current data set.

Purpose

You use this construct to determine whether the current data set or the specified collection contains at least one occurrence of a particular object.

Syntax

there is at least one <object> [in <list>] [where <test>,*]

Description

Use the optional in clause to apply the test to a specific collection of objects. Use one or more optional where clauses to filter the objects to be counted with one or more conditions. Use an optional time filter operator to filter the objects to be counted according to a specific time period or time point.

This construct can only be used in the if part of a rule.

Example

The following condition tests whether or not a purchase event happened.

if
    there is at least one purchase event 
        where...
then...

The following condition tests if a Gold customer made an expensive purchase in the last two months.

definitions
  set ‘expensive purchases’ to all purchase events
      where the amount of each purchase event is more than 1000;
if
   there is at least one purchase event in ‘expensive purchases’ during the last period of 2 months
where the category of the customer of this purchase event is Gold,
then...