Skip to content

Text Comparison Rule (text_comparison) ​

Performs comparison of text values in 2 columns and creates a flag for data in a third column.

FieldDescriptionRequired
reference_columnColumn containing the reference valuesβœ… Yes
comparison_columnColumn containing the comparison valuesβœ… Yes
destination_columnColumn that will be populated with the matched_value or unmatched_valueβœ… Yes
operatorUse == to test if reference_column is equal to comparison_column. Use != to test if reference_column is not equal to comparison_columnβœ… Yes
matched_valueNumeric value placed in destination_column if the comparison is true.βœ… Yes
unmatched_valueNumeric value placed in destination_column if the comparison is not true.βœ… Yes

Example: ​

json
{
    "type": "text_comparison",
    "reference_column": "sex",
    "operator": "==",
    "comparison_column": "female",
    "destination_column": "sexn",
    "matched_value": 1,
    "unmatched_value": 0
}

Behavior: If the text in sex column matches text in female column, the sexn column is populated with a 1, otherwise it is populated with a 0.