Difference between revisions of "Aggregate Functions"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
Line 1: | Line 1: | ||
===Aggregate Functions=== | |||
Aggregate Functions | |||
====Overview==== | |||
These functions give you the ability to select a group of records from an arbitrary object and | |||
produce an aggregate value (SUM, COUNT, MAX, MIN, AVG), without having to write Java code. | |||
====Functionality==== | |||
:{| border="1" cellpadding="1" cellspacing="1" | |||
! Methods !! Field Types | |||
|- | |||
| SUM(<em>object_id, object_field, criteria</em>) || number, currency, boolean | |||
|- | |||
| AVG(<em>object_id, object_field, criteria</em>) || number, currency, boolean</td> | |||
|- | |||
| MAXIMUM(<em>object_id, object_field, criteria</em>) || number, currency, date | |||
|- | |||
| MINIMUM(<em>object_id, object_field, criteria</em>) || number, currency, date | |||
|- | |||
| COUNT(<em>object_id, criteria</em>) || n/a | |||
|} | |||
where: | where: | ||
:* '''object_id -''' Object Name or Object Identifier | |||
:* '''object_field -''' Field in the specified object | |||
:: '''Restriction:''' A Lookup field cannot be used. | |||
Β | |||
:* '''criteria: -''' A condition that specifies the object records that are part of the collection. | |||
::* Syntax is same as searchRecords() API of JAVA/REST criteria<br /> | |||
The relevant information is here (only the page title is inappropriate): [[JAVA_API:Filter_Expressions_in_JAVA_APIs]] | |||
::* Criteria must contain at least one index field. If index is combination of fields, the criteria must contain first field in that index. (It does not need to be a unique index, but an index is required, for performance.) | |||
:::'''Note:''' The maximum number indexes currently allowed in an index definition is 5. | |||
Syntax is same as searchRecords() API of JAVA/REST criteria<br /> | Β | ||
The relevant information is here (only the page title is inappropriate): | ;Considerations: | ||
:* The SUM() of a boolean field gives a count of values that are yes/true. | |||
:* The AVG() of a boolean field gives the percentage that are yes/true. | |||
Criteria must contain at least one index field. If index is combination of fields, the criteria must contain first field in that index. | Β | ||
{{Note|The results doenot take into account user-security restrictions. These functions operate on | |||
the entire set of records in an [[Object]], regardless of user capabilities.}} | |||
Β | |||
The maximum number indexes allowed in an index definition is | |||
The SUM() of a boolean field gives a count of values that are yes/true. | |||
The AVG() of a boolean field gives the percentage that are yes/true. | |||
====Availability==== | ====Availability==== | ||
Line 100: | Line 44: | ||
::* Criteria (Action Based - Add, Updae, Delete, Import Record, Ownership Change, Workflow State Change) | ::* Criteria (Action Based - Add, Updae, Delete, Import Record, Ownership Change, Workflow State Change) | ||
::* Add/Update Record Action | ::* Add/Update Record Action | ||
:* Calendar Data Policies - Criteria Not Support | :* Calendar Data Policies - Criteria Not Support | ||
:* Calendar Data Policies - Add/Update Record Actions Aggregate functions will be evaluated.</li> | :* Calendar Data Policies - Add/Update Record Actions Aggregate functions will be evaluated.</li> | ||
:* Default Values | :* Default Values |
Revision as of 20:09, 10 February 2012
Aggregate Functions
Overview
These functions give you the ability to select a group of records from an arbitrary object and produce an aggregate value (SUM, COUNT, MAX, MIN, AVG), without having to write Java code.
Functionality
Methods Field Types SUM(object_id, object_field, criteria) number, currency, boolean AVG(object_id, object_field, criteria) number, currency, boolean MAXIMUM(object_id, object_field, criteria) number, currency, date MINIMUM(object_id, object_field, criteria) number, currency, date COUNT(object_id, criteria) n/a
where:
- object_id - Object Name or Object Identifier
- object_field - Field in the specified object
- Restriction: A Lookup field cannot be used.
- criteria: - A condition that specifies the object records that are part of the collection.
- Syntax is same as searchRecords() API of JAVA/REST criteria
- Syntax is same as searchRecords() API of JAVA/REST criteria
The relevant information is here (only the page title is inappropriate): JAVA_API:Filter_Expressions_in_JAVA_APIs
- Criteria must contain at least one index field. If index is combination of fields, the criteria must contain first field in that index. (It does not need to be a unique index, but an index is required, for performance.)
- Note: The maximum number indexes currently allowed in an index definition is 5.
- Considerations
-
- The SUM() of a boolean field gives a count of values that are yes/true.
- The AVG() of a boolean field gives the percentage that are yes/true.
Note: The results doenot take into account user-security restrictions. These functions operate on the entire set of records in an Object, regardless of user capabilities.
Availability
The Aggregate Functions are available here:
- Validations
- Data Policies
- Criteria (Action Based - Add, Updae, Delete, Import Record, Ownership Change, Workflow State Change)
- Add/Update Record Action
- Calendar Data Policies - Criteria Not Support
- Calendar Data Policies - Add/Update Record Actions Aggregate functions will be evaluated.
- Default Values
- Formula Fields
They are not available here:
- Layout Rules
- Custom Access Criteria
- Reports