Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have below two tables that are to be linked based on ORDER field as well as PRODUCT field. How can i link the tables with out forming a Synthetic key?
| Header 2 | Header 3 | Header 4 | Header 5 | |
|---|---|---|---|---|
| order1 | product1 | region | area | sales |
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
|---|---|---|---|---|
| Order2 | Product2 | market | Business group |
Can't you just join the tables together?
Table:
LOAD order1 AS order, product1 AS product, region, area, sales
FROM YourSource;
OUTER JOIN (Table)
LOAD Order2 AS order, Product2 AS product, market, [Business group]
FROM YourSource2;
You can change the join to be inner/outer/left/right as necessary.
use Key function to generate a new key values based not the combination and re-name the filed names to avoid synthetic key formation....
You can concatenate them if they are facts from different sources you need to distinguish (e.g.: sales and budget), or rename the fields if they have nothing to do even if they have the same field names and load two different tables, and leave the product and order fields unchanged.
If you really don't want to have the synthetic key, use
AutoNumber(Order & '|' Product) AS KeyField
in both tables in the load script.
This link might be useful: