Developing Apama Applications > EPL Reference > Queries > Find statement > Having clause
Having clause
A find statement that specifies the every keyword can specify a having clause to restrict when procedural code is invoked.
Specify the having keyword followed by a Boolean projection expression. The Boolean projection expression refers to an aggregate calculation. Procedural code is executed only when the Boolean projection expression evaluates to true.
You can specify zero, one, or more having clauses. When you specify more than one having clause, it is equivalent to specifying the and operator. That is, each Boolean projection expression must evaluate to true for the procedural code to be executed.
A having clause can refer to an aggregate value by using the select coassignment name.
When you want to test for an aggregate condition but you do not want to use the aggregate value, you can specify a having clause without specifying a select clause.
Examples:
find every A:a
select avg(a.x):aax
having aax > 10.0 {
print aax.toString();
}
find every A:a
having avg(a.x) > 10.0 {
print "Average value is greater than ten!";
}
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.