Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Appendix B Format of Search, Return and Sort Expressions> B.4 Return Expressions

B.4.3 Format Used when Aggregating

To aggregate data, specify text expressions, attribute expressions single-line function specifications, or aggregation function specifications in the return expression. Multiple specifications can be entered, each separated with commas. The return expression must include at least one aggregation function specification.

A sort expression must be specified when aggregating. Refer to B.5 Sort Expressions for more information on sort expressions.

[Figure B-20 Format Used when Aggregating]

The return items are shown below.

mark1Text Expressions

Specify a text expression when extracting a key for aggregation.

Refer to B.2.2 Text Expressions for more information on the format for text expressions.

Example

/doc/company/employee/dept/text()

mark1Attribute Expressions

An attribute expression is used for extracting the key for aggregation.

Refer to B.2.3 Attribute Expressions for more information on the format for attribute expressions.

Example

/doc/company/employee/@position

mark1Single-line Function Specification

Specify single-line functions and extract the value of them when using single-line function specifications as the key for aggregation.

Refer to B.2.4 Single-line Function Specification for more information on the format for single-line function specifications.

Example 1

rlen(/doc/company/employee/name/text(),3)

Example 2

rlen(/doc/company/employee/@position,3)

mark1Aggregation Function Specifications

Aggregation function specifications aggregate the values specified by the text expression or attribute expression passed as an argument.

The definition format for aggregation function specifications is shown below.

[Figure B-21 Aggregation Function Specification Definition]

mark2The avg Function

Extracts only numeric values from the strings expressed by the text expression or attribute expression and determines the average of these values.

mark2The sum Function

Extracts only numeric values from the strings expressed by the text expression or attribute expression and determines the sum of these values.

mark2The max Function

Extracts only numeric values from the strings expressed by the text expression or attribute expression and determines the maximum of these values.

mark2The min Function

Extracts only numeric values from the strings expressed by the text expression or attribute expression and determines the minimum of these values.

mark2The count Function

Determines the number of elements specified by the text expression or attribute expression.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006