transformations:merge
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
transformations:merge [2018/04/30 09:44] – dmitry | transformations:merge [2024/04/11 23:55] (current) – add inner join craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Merge another table ===== | + | {{ transformations: |
+ | ====== | ||
+ | Category: Transform / Basic\\ | ||
- | This transformation | + | \\ |
+ | =====Description===== | ||
+ | This action | ||
- | There are three possible merge modes: | + | There are four possible merge modes:\\ |
+ | |||
+ | ====Lookup Mode==== | ||
+ | Retrieve the //first// matching combination from the other table. Any subsequent combinations are ignored.\\ | ||
+ | \\ | ||
+ | ====Left Join Mode==== | ||
+ | Retrieve //all// matching combinations from the other table. This mode can increase the number of rows in the current table as rows are duplicated to hold any multiple matches from the second dataset.\\ | ||
+ | \\ | ||
+ | ====Full Join Mode==== | ||
+ | Include all combinations of keys from both tables. Similar to the full outer join in SQL.\\ | ||
+ | \\ | ||
+ | ====Inner Join Mode==== | ||
+ | Include only matching rows from both tables.\\ | ||
- | | + | \\ |
- | * Left Join Mode -- get **all** matching combinations | + | =====Use cases===== |
- | * Full Join Mode -- include all combinations of keys from both tables. Equivalent to the full outer join in SQL. | + | |
+ | * (Left Join Mode) Blend in additional data from other tables into the primary dataset. | ||
+ | * (Full Join Mode) Combine two entire datasets to be cleaned and consolidated downstream. | ||
+ | * (Inner Join Mode) Connect only rows from both tables | ||
- | EXAMPLE | + | \\ |
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |Add columns from table|Select table that will return columns to the current dataset where values match.| | ||
+ | |Where all these columns match|Select the columns within the current dataset (left drop-down) and the second dataset (right drop-down) where\\ values will match. | ||
+ | |Merge mode|Options: | ||
+ | |Return columns|From the list, select the columns from the second dataset that will be appended to the current dataset.| | ||
+ | The reference to the second table will appear as a dotted line connecting this action to the second dataset in the application window. | ||
- | **Table 1:** The longest rivers in the world | + | \\ |
+ | =====Remarks===== | ||
+ | Matching is case-sensitive. | ||
- | ^ River ^ Length | + | Values must be identical |
- | | Nile | 6650 | Africa | + | |
- | | Amazon | + | |
- | | Yangtze | + | |
- | | Mississippi | + | |
- | **Table 2:** The outflow | + | For an inner join use the [[transformations:keepremovematching|Keep/ |
- | ^ River ^ Outflow | ||
- | | Nile | Mediterranean | ||
- | | Amazon | ||
- | | Yangtze | ||
- | | Mississippi | ||
+ | \\ | ||
+ | =====Examples===== | ||
- | **Objective: | ||
- | **Transformation:** | + | **Example:** Merge the " |
- | | + | **Table 1:** The longest rivers in the world\\ |
- | * Column: Outflow | + | |
- | | + | |
- | **Result:** | + | ^River |
+ | | Nile | 6650|Africa | ||
+ | | Amazon | ||
+ | | Yangtze | ||
+ | | Mississippi | ||
+ | \\ | ||
+ | **Table 2:** The outflow\\ | ||
- | ^ River ^ | + | ^River |
- | | Nile | | + | | Nile |Mediterranean |
- | | Amazon | + | | Amazon |
- | | Yangtze | + | | Yangtze |
- | | Mississippi | + | | Mississippi |
+ | \\ | ||
+ | **Action parameters: | ||
- | === Limitations === | + | > Add columns from table: Table 2 |
- | The resulting | + | > Where values in Table 1 " |
+ | > Merge mode: Left join (add all matching | ||
+ | > Return column: Outflow | ||
- | === See also === | + | \\ |
+ | **Result table: | ||
+ | |||
+ | ^River | ||
+ | | Nile | 6650|Africa | ||
+ | | Amazon | ||
+ | | Yangtze | ||
+ | | Mississippi | ||
+ | |||
+ | \\ | ||
+ | ====Community examples==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
* [[transformations: | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
transformations/merge.1525095847.txt.gz · Last modified: 2018/04/30 09:44 by dmitry