Compare two tables to identify the differences
Author: Sheetal Dehadaraya, Software Labs Inc.
|
Sometimes, we are required to compare two similar data sources to identify the values that are not the same. FindChangedFields function in xFusion can provide a side-by-side comparison between two sources. The output is good for visual inspection.
This function takes parameters as the two tables to compare, one or more columns on which the tables are to be matched and columns that need to be compared.
If null is passed as the last parameter it means that you want to compare all the columns in the tables.
FindChangedFields([[SourceTable]], [[FixedTable]], Array('Key'), null)
FindChangedFields([[SourceTable]], [[FixedTable]], Array("Key"), "City", "State")
The result from the function display's the before and after of any source data. So at a glance one can
see all the transformations that have happened on the source data.
These two data sources can come from different systems. For example, you can
compare an Excel spreadsheet with your data in SAP.
Note: The columns that need to be compared must have the same names in both the tables. The null values in the output indicate that the data in those columns is identical.
Download the sample fusion pack from here to demonstrates the usage of "FindChangedFields" function.
|
|
|