Merging tables

You can merge two sorted ACL tables with identical record structures into a new third table that uses the same sort order as the original tables.

To merge tables:

  1. Do one of the following:
    • Open the primary table and select Data > Merge Tables.

    • Open the primary table, right-click the secondary table and select Open as Secondary, and select Data > Merge Tables.

  2. On the Main tab, if you have not already opened the secondary table, select it from the Secondary Table drop-down list.

    In the Project Navigator, the primary and secondary table icons update with the numbers 1 and 2 to indicate their relation to each other    .

  3. Compare the primary and secondary table fields to ensure they have an identical data structure.

    The number and order of fields, and the length of corresponding primary and secondary table fields, must be identical. Field names can be different. Only character fields, and character computed fields, are displayed. Fields not displayed must also have an identical data structure between the two tables, including identical data type, and date/datetime format, if applicable.

    Tip

    Prior to merging, you can use the Join dialog box to display all fields in the two tables, regardless of data type, which allows a more thorough comparison of primary and secondary table fields.

  4. Select primary and secondary key fields by doing the following:
    1. Select one or more primary key fields from the Primary Keys list.

      You can also click Primary Keys to select the field(s), or to create an expression. You are prevented from specifying a descending sort order for primary key fields because merging only works if key fields are sorted in ascending order.

    2. Select one or more secondary key fields from the Secondary Keys list.

      You can also click Secondary Keys to select the field(s). You cannot create an expression for a secondary key field, or specify a descending sort order.

    Key field guidelines:

    • The primary key field must be sorted in ascending order. The field can be previously sorted, or you can sort it using the Presort Primary Table option during the merge operation.

    • The secondary key field must be sorted in ascending order. The secondary key field must already be sorted because there is no Presort option for the secondary key field.

    • Regardless of the order in which you select key fields, the field order in the resulting merged table is the same as the field order in the active tables.

    • If you want to merge two tables using more than one primary and secondary key field (that is, more than one common key), see Requirements when merging tables.

  5. If the primary table is already sorted, deselect Presort Primary Table, otherwise leave it selected.
  6. If you are connected to a server table, do one of the following:
    • Select Local to save the output table to the same location as the project, or to specify a path or navigate to a different local folder.

    • Leave Local deselected to save the output table to the Prefix folder on the ACL Server.

      Note

      For output results produced from analysis or processing of ACL Analytics Exchange server tables, select Local. You cannot use the Local setting to import results tables to ACL Analytics Exchange Server.

  7. Select or deselect Use Output Table depending on whether or not you want the ACL table containing the output results to open automatically upon completion of the operation.
  8. If there are records in the primary view that you want to exclude from processing, enter a condition in the If text box, or click If to create an IF statement using the Expression Builder.

    The IF statement considers all records in the primary view and filters out those that do not meet the specified condition.

  9. Do one of the following:
    • In the To text box, specify the name of the ACL table that will contain the output results.

    • Click To and specify the ACL table name, or select an existing table in the Save or Save File As dialog box to overwrite or append to the table.

    If ACL prefills a table name, you can accept the prefilled name, or change it.

    You can also specify an absolute or relative file path, or navigate to a different folder, to save or append the table in a location other than the project location. For example: C:\Results\Output.fil or Results\Output.fil. Regardless of where you save or append the table, it is added to the open project if it is not already in the project.

  10. Click the More tab.
  11. Select the appropriate option in the Scope panel.
    • All – This option is selected by default. Leave it selected to specify that all records in the primary view will be processed.

    • First – Select this option and enter a number in the text box to start processing at the first record in the primary view and include only the specified number of records.

    • Next – Select this option and enter a number in the text box to start processing at the currently selected record in the primary view and include only the specified number of records. The actual record number in the leftmost column must be selected, not data in the row.

    • While – Select this option to use a WHILE statement to limit the processing of records in the primary view based on a particular criterion or set of criteria. You can enter a condition in the While text box, or click While to create a WHILE statement using the Expression Builder.

      A WHILE statement allows records in the primary view to be processed only while the specified condition evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no further records are considered. You can use the While option in conjunction with the All, First, or Next options.

    Note

    The number of records specified in the First or Next options references either the physical or the indexed order of records in a table, and disregards any filtering or quick sorting applied to the view. However, results of analytical operations respect any filtering.

    If a view is quick sorted, Next behaves like First.

  12. If you want to append the output results to the end of an existing ACL table, do one of the following:
    • Select Append To Existing File if you are certain the output results and the existing table are identical in structure.

    • Leave Append To Existing File deselected if you want ACL to compare the record lengths of the output results and the existing table. If the record lengths are not identical, the data structure is not identical.

    Note

    Leaving Append To Existing File deselected is recommended if you are uncertain about the data structure. For more information about appending and data structure, see Appending results to ACL tables and text files.

  13. Click OK.
  14. If the overwrite prompt appears, select the appropriate option.

    If you are expecting the Append option to appear and it does not, click No to cancel the operation and see Appending results to ACL tables and text files.

Related concepts
Saving results and specifying results output folders
About merging tables


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