Specifications
Percent
722 InfoMaker
Usage
Usually you use Percent in a column to display the percentage for each row.
You can also use
Percent in a header or trailer for a group. In the header,
Percent displays the percentage for the first value in the group, and in the
trailer, for the last value in the group.
If you specify range,
Percent returns the percentage that the current row of
column represents relative to the total value of range. For example, if column
5 is salary,
Percent(#5 for group 1) is equivalent to
salary/(Sum(Salary for group 1)).
If you specify DISTINCT,
Percent returns the percent that a distinct value in
column represents of the total value of column. If you specify expresn,
Percent
returns the percent that the value in column represents of the total for column
in a row in which the value of expresn is distinct.
Formatting the percent value
The percentage is displayed as a decimal value unless you specify a format for
the result. A display format can be part of the computed field’s definition.
For graphs and OLE objects, you do not select the range when you call the
function. The range has already been determined by the Rows setting on the
Data property page (the Range property), and the aggregation function uses
that range. Settings for Rows include the following:
• For the Graph or OLE presentation style, Rows is always All.
• For Graph controls, Rows can be All, Page, or Group.
• For OLE controls, Rows can be All, Current Row, Page, or Group. The
available choices depend on the layer the control occupies.
Null values are ignored and are not considered in the calculation.
Not in validation rules, filter expressions, or crosstabs
You cannot use Percent or other aggregate functions in validation rules or filter
expressions. Percent does not work for crosstabs; specifying “for crosstab” as
a range is not available for Percent.
Using an aggregate function cancels the effect of setting Retrieve Rows As
Needed in the painter. To do the aggregation, a report always retrieves all rows.
Examples This expression returns the value of each row in the column named salary as a
percentage of the total of salary:
Percent(salary)