Skip to main content

Custom Hash Fields

In scenarios with multiple fields making up the primary key, hashing the values of those fields into a single field can improve lookup performance. In TimeXtender Data Integration, such a field is called a custom hash field, and this field can also be used to easily investigate whether changes have been made to a record or not.

Adding a custom hash field

  1. Right-click on a table and select "Add Custom Hash Field". A custom hash field will be added to the table and selected, and the "Custom Hash Key" pane will appear on the right-hand side of the window.
  2. In the Custom Hash Key pane, select the fields to include in the custom hash field.
  3. (Optional) Use the "Field Order" option to reorder the fields using drag-and-drop or ALT + Up/Down. To ensure an accurate comparison of two custom hash fields, verify that the field sequence is the same for both hash fields. Otherwise, the hash value may differ even if the individual field values that make up the hash fields are the same.

Changing the Hashing Algorithm for a Field

For compatibility reasons, we offer a number of different algorithms for hashing fields. These hashing algorithms are available on all hashed fields in your instance.

In addition to custom hash fields, the following hash fields are also available:

  • Junk dimension key
  • Surrogate hash key, type I hash key and type II hash key (used for history)

Note: There is usually no reason to change the hashing algorithm for an individual field. The default setting ensures that all hash fields use the same algorithm which in turn makes it possible to compare the values of the individual fields. The most common exceptions are debugging purposes and "upgrading" the hashing algorithm of a field that was created in an earlier version.

To change the hashing algorithm of a hash field

  • Right click the field, click Hashing algorithm and click the hashing algorithm you want to use. 

     

Hi, 

Custom hash field may create a hashed representation of combination of multiple fields eventhough one of the fields contains NULL. how do i change this behaivor to create hash only of ALL fields are filled? 

 

With kind regards, 

 

Dror  


Hi @dsvartzman 

You will need to create a std field with a varbinary(20) data type and then you need to run the conversion with a custom transformation.

HASHBYTES('SHA1', CONVERT(VARCHAR(20), COALESCE(val1, val2, ...., val_n)))

You can then add conditions on the transformation so it only runs when all fields are not null.


Hi Thomas, 

Eventhough a year later, thank you for the verry helpful answer 


Reply