Often times people receive data files where every record does not contain all of the pertinent information. For example, when the data arrives it has the format of the first table, but in order to use it, you need the data to be in the format of the second table.
| Transaction | Name | Account | Amount | Description |
| ABC12345 | TUG Group
| 1111 | 234.12 | Consulting Fee
|
| | 22222 | 432.43 | Parts |
| | 33333 | 12.12 | Tax |
| Transaction | Name | Account | Amount | Description |
| ABC12345 | TUG Group
| 1111
| 234.12
| Consulting Fee
|
| ABC12345 | TUG Group
| 22222 | 432.43 | Parts |
| ABC12345 | TUG Group
| 33333 | 12.12 | Tax
|
ACL has two ways of doing this. The first way requires you to utilize the IMPORT TO PRINT command while loading the data and select the option Fill if Blank (FB). The second, more common way to fill the empty spaces is to use an option called "STATIC"Using the Static command requires that you create a new field.
The STATIC option can be accessed either through the Table Layout Editor or in a script.
To utilize the Static option via the Table Layout Editor, goto Edit > Table Layout. When you are defining a field, put a logical expression in the box besides the "IF". In the above example, you might use the expression: Name = "". When you put a value in the IF box, the "Static box" which had previously been greyed out will become active. If you check the box by Static, then ACL will fill the empty boxes with the last value of a populated box when the logical equation in the IF box is true.
To utilize the Static option via a script, one would use the following:
DEFINE FIELD
field_name COMPUTED
<IF
condition> <STATIC>
value1 IF
condition1
value2 IF
condition2
…
default value
Notice when using the STATIC option, there is not the traditional empty space between the DEFINE FIELD line and the various values. Using the above example, one would use the following:
DEFINE FIELD new_field COMPUTED
IF name = "" Name
Name
One thing to remember about using the Static command in defining a field, after creating the field(s) you should EXTRACT FIELDS ALL immediately.