About computed fields

Computed fields are fields that are defined using ACL expressions. They are called computed fields because they display the result of the expression, which can be the result of a calculation or operation, or the return value of an ACL function. Computed fields are used to display information in an ACL table that is not present in the data source, or is not in the required format in the data source.

The following list outlines several ways you can use computed fields:

There are three general categories of computed fields you can create, which are described below:

Standard computed fields

Standard computed fields are fields that do not have any conditions defined. These computed fields are defined by specifying a name and a default value, a literal value or expression, which determines the data type of the field. Depending on the data type specified you may be able to specify additional properties for the field. Field names are limited to 31 characters. The name must start with an alphabetic character and any spaces are replaced with the underscore character.

When ACL processes standard computed fields the expression or value specified in the Default Value text box is applied to each row in the table. Two options that can be specified when defining the computed field that affect whether or not the output of the expression is used:

Conditional computed fields with constant values

You can define computed fields that evaluate to particular constant values, which is useful if you want to replace the values in a column based on a known pattern. For example, if a physical data field in your table uses a numeric code to identify company branches, you could define a conditional computed field to display the appropriate location for each code.

You could create a computed field named “City” and then define a condition for each branch location you want to identify. Each condition would define the branch code to match (Branch = 01) and the value to substitute (“London”).

When you create the computed field you need to specify a default value, which is not conditional. If all of the conditional are evaluated and all are evaluated as false, the default value is used. In this example, you could specify “UNKNOWN” to highlight the fact that no matching branch has been identified.

Conditional computed fields with computed values

You can define computed fields where the calculation that occurs depends on which condition evaluates to true.For example, you could calculate royalties based on sales from different locations. If the royalties payable are 10% on European sales, 20% on American sales and 15% otherwise, you can define a conditional computed field named Royalty (with a default value of Value * 0.15) to help simplify your calculations.

The conditions would be based on the Location field (for example, LOC= “03” OR LOC= “04” for American sales), and their values would be the corresponding Market Value percentage (for example, Value * 0.20 for American sales).

The value of the Royalty field takes on a different value for each record in the table, depending on each transaction’s branch location. To calculate the total worldwide royalties payable, use the Total command to compute the value of the Royalty field.



(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback