{{ transformations:compare.png}} ====== COMPARE TABLES ====== Category: Transform / Advanced\\ \\ =====Description===== This action compares two tables and produces a list of detected differences based on column metadata. \\ =====Use cases===== Use this action to compare the current version of a dataset against an earlier one to determine if it has changed, and what those changes were. This action can be used to drive workflow branching based on whether the two comparison tables match. \\ =====Action settings===== The only setting for his action is selecting the //Other table// to compare to. ====Results==== The result of this action is a dataset containing the columns //Verdict//, //Column//, //This table//, and //Other table//. ^Column ^Description ^ |Verdict |This column contains descriptions of the differences found, per column, between the tables. | |Column |This column lists the names of the Columns involved. | |This table |This column lists the values in the current dataset associated with the Verdict in the Column shown. | |Other table |This column lists the values in the other table associated with the Verdict in the Column shown. | \\ The following verdicts are created when columns have been //added// or //removed// between the datasets. *Column removed (column name is missing in the //other// dataset) *Column added (column name is missing in //this// dataset) Tests below are performed **only if the //other dataset// contains at least one column from the //this dataset//**. Tests are conducted for columns from the //current dataset//. *The order of columns has changed (additional pre-requisite: no columns added or removed) *Values have //become// or //stopped// being unique *Column vocabulary has got one or more new values *Column vocabulary has lost one or more values *The number of rows has //increased// or //decreased// Tests below are performed **only if the number of rows has not changed** and //other dataset// contains at least one column from //this dataset//. *Has //fewer// or //more// integer numbers *Has //fewer// or //more// non-integer numbers *Has //fewer// or //more// text values *//Has// or //doesn't have// empty values *//Has// or //doesn't have// errors *//Has// or //doesn't have// booleans Additional numerical and text-based comparisons. *The min number value is different *The max number value is different *The min text length is different *The max text length is different *The min text length is different \\ =====Remarks===== If both tables are //exactly the same// the resultant dataset will be empty and the action icon will show //green//. Otherwise, the action icon will show //red//. If both tables are //completely different//, the result will be a "Column removed" verdict for each column in the original dataset followed by a "Column added" verdict for each column in the comparison dataset. \\ =====Examples===== ====Example #1==== >Compare Table 1 to Table 2 to determine any differences. ===Before (source table)=== Table 1: Table with "Compare tables" action. ^River ^Length (km) ^Continent ^ | Nile | 6650|Africa | | Amazon | 6400|South America | | Mississippi | 6275|North America | Table 2: Table to compare to. ^River ^Length (km) ^Length (miles)^ | Nile | 6650| 4132| | Amazon | 6400| 3976| | Mississippi | 6275| 3902| ===After (result table)=== ^Verdict ^Column ^This table ^Other table ^ |**Column removed** |**Continent** | | | |**Column added** |**Length (miles)** | | | ===Action parameters=== >Other table: Table 2 \\ =====See also===== * [[transformations:metadata|Table metadata]]