Home > Databases > Import / Export Data > Merge Data

Merge Data

The Merge Data command merges fields from a Source database into the corresponding fields of a Target database.

Note: if you simply want to add new records after the existing records of the current database, you should generally use the Append Data command instead of the Merge Data command.

Select Merge Data (or click Merge from the ribbon in spreadsheet edit) to open the Merge Data Library. Select an existing set of Merge Data parameters, or click New to create a new set of parameters.

Each entry must have a Name in order to be saved in the library.

The Target database represents the database that will receive update data. This may be set as the "<Current database>" for cases in which you want ProVal's current database to receive the update data. The Source database is the database file which contains the data to be merged into the target database.

To select only some of the records in the source database, enter a Selection expression to apply to the source databaseIf you leave the Selection Expression box blank, then all records will be merged. Press the F1 key when your cursor is in this box to get a list of the operators you can use to create the expression.

Select one or more Key fields. If you choose a character field, check Match case in keys if you wish to treat case differences as significant (so “Joe Smith” and “JOE SMITH” will be treated as different key values).

Alt Key is an optional parameter that can be used to specify a secondary key field (or fields). When a matching record cannot be found based on the primary key field(s), a second check is performed using the alternate key. This can be helpful in situations where employee ID numbers are corrected from one year to the next. As an example, consider a current year database with primary key field EEID and alternate key field OLDEEID. When matching EEID in the current year database against the imported data, a second step will be taken for any for any unmatched records. Those unmatched records in the current year will also have the alternate key field OLDEEID checked for possible matches against EEID in the imported data.

Select one or more source fields to read (to import into the target database) from the list of all fields in the source database. An asterisk (*) marks fields that are defined in both the target database and the source database. Click the All or None buttons to select all or none of the fields in the source database, respectively. By default, fields in the source database are used to update identically named fields in the target database. To choose different names for the imported fields, click the Target Flds… button.

The Target Fields dialog box lists the Fields in Source Database that you’ve chosen to import in the first column of the spreadsheet. The second and third columns lists the Fields in Target Database into which these fields will be mapped. Choose whether to map fields into Existing Fields by selecting a field which already exists in the Data Dictionary from the drop down, or choose to map into a New Field in the target database by naming that new field in the third column of the spreadsheet.

The last onscreen options dictate how the data update should be performed. The first option specifies what should be done for records that were found in both files (i.e., records that were "matched" based on value(s) of the key field(s)). Select, for records found in both files, if you want to overwrite:

The second option specifies what should be done with the records themselves (i.e., what records should be preserved in the merged target database). Select, in the merged target database, whether you want to keep records if present in:

Lastly, the option to Create MergeStatus field allows you to specify whether you want a "merge status" field in the database. This coded field, which will be named MergeStatus, classifies each record as one of:

Click the Run button to perform the merge. When the merge is complete, the system displays a summary of what was done and asks for confirmation before saving the changes in the file. The summary includes the following information:

Click “Yes” to save the changes, or click “No” to discard the changes and return to the Merge Data parameters. If you choose “No”, the merge will be canceled, but any new fields that were created (and filled with missing values) during the merge will still exist. You can erase these fields, if you wish, by using the Database > Edit Data > Delete Fields command.

Note: The Merge Data command produces large amounts of unused space in the database file, even if you choose not to save the changes made in the update. You can eliminate the unused space by running the File > Pack Files command.