span8
span4
span8
span4
I'm aiming to compare the values of multiple tables from two different data sources with FME. I've already prepared two tables, that list all values from either data source.
The 'left data source', consisting of two tables (FruitandVegetable) and their values over various columns:
Id | LeftTableName | LeftColumnName | LeftValue |
1 | Fruit | Name | Apple |
1 | Fruit | Color | Red |
1 | Fruit | Kcal | 52 |
2 | Fruit | Name | Banana |
2 | Fruit | Color | Yellow |
2 | Fruit | Kcal | 89 |
3 | Vegetable | Name | Carrot |
3 | Vegetable | Color | Orange |
3 | Vegetable | Shape | Pointy |
The 'right data source', consisting of two tables (FRUITSandVEGETABLES) and their values over various columns:
Id | RightTableName | RightColumnName | RightValue |
1 | FRUITS | DESCRIPTION | Apple |
1 | FRUITS | COLOR | Yellow |
1 | FRUITS | CALORIES | 52 |
2 | FRUITS | DESCRIPTION | Banana |
2 | FRUITS | COLOR | Yellow |
2 | FRUITS | CALORIES | 90 |
3 | VEGETABLES | DESCRIPTION | Carrot |
3 | VEGETABLES | COLOR | Orange |
3 | VEGETABLES | SHAPE | Pointy |
The tables and columns of both data sources can be related using the following mapping:
LeftTableName | LeftColumnName | RightTableName | RightColumnName |
Fruit | Name | FRUITS | DESCRIPTION |
Fruit | Color | FRUITS | COLOR |
Fruit | Kcal | FRUITS | CALORIES |
Vegetable | Name | VEGETABLES | DESCRIPTION |
Vegetable | Color | VEGETABLES | COLOR |
Vegetable | Shape | VEGETABLES | SHAPE |
How can I implement the above mapping to compare the values from both data sources? The desired result looks like this:
Id | LeftTableName | LeftColumnName | LeftValue | RightValue |
1 | Fruit | Name | Apple | Apple |
1 | Fruit | Color | Red | Yellow |
1 | Fruit | Kcal | 52 | 52 |
2 | Fruit | Name | Banana | Banana |
2 | Fruit | Color | Yellow | Yellow |
2 | Fruit | Kcal | 89 | 90 |
3 | Vegetable | Name | Carrot | Carrot |
3 | Vegetable | Color | Orange | Orange |
3 | Vegetable | Shape | Pointy | Pointy |
After trying a bit more, I came up with this solution:
© 2020 Safe Software Inc |Legal