0019 Compare two values

A practical Advanced ETL Processor example for building, testing, and adapting one automation workflow.

Advanced ETL Processor
4.9 ★★★★★ Based on 16 reviews on Capterra See all reviews on Capterra →

Use this example to build one working automation package, test it safely, and then adapt it to your own files, folders, or data rules. Start small. Automation is helpful; automated mistakes are just faster mistakes.

Compare two values during transformation

This example shows how to compare two input values and populate an output column based on the result. Advanced ETL Processor can do this in several ways. The best option depends on the rule, the data volume, and whether the person maintaining it later should still like you.

Source data example

The source data contains values that need to be compared before the output column is populated.

Source data for comparing two values

Run the example

  • Download and install Advanced ETL Processor [Link]
  • Download and unzip the example [Link]
  • Create a new transformation and open the .ats file.
  • Double-click the Reader object and amend the source file path.
  • Double-click the Writer objects and amend the target file path, leaving the calculation intact.
  • Press the green arrow to run the transformation.

Transformation overview

The sample transformation demonstrates four ways to compare values. Using a calculation transformation is usually the slowest option, so use it when the rule needs calculation logic rather than a simpler comparison function.

Logical operation transformation data flow

Option 1: Compare Values transformation function

Use the Compare Values transformation function when the rule is a direct comparison between two fields.

Compare Values transformation function

Option 2: Calculation transformation

Use a calculation when the comparison needs extra logic. This is flexible, but normally slower than a dedicated transformation function.

Logical operations using calculation transformation

Calculation properties for comparing values

Option 3: Lookup transformation

Use a lookup when the comparison depends on a reference table or a mapping list rather than only two values in the same row.

Lookup logical operation

Lookup transformation properties for value comparison

Lookup field mapping properties

Option 4: If Equal To transformation function

Use the If Equal To transformation function when the logic only needs to check whether two values are the same.

If Equal To transformation function

More help

There are other ways to transform the data. Contact us if you need help choosing the right approach.

Visit ETL Tools Forum

Related Advanced ETL Processor resources

For more automation examples, review the Advanced ETL Processor tutorials, read the WIKI, or download the Advanced ETL Processor Enterprise trial.