Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
deepak_km9886
Creator
Creator

How to create link table by getting rid of sync table

I have following sample and i am getting synthetic keys. I dont want to rename the fields and get rid of synthetic keys, rather i want to eliminate it by creating link table,

can anyone please help me with this by providing the script. I want the key for region,territory and district.

Screenshot (79).png

1 Solution

Accepted Solutions
vitaliichupryna
Creator III
Creator III

Hi Deepak,

See script below:

Table1:
Load
      Region&’|’&Territory&’|’&District AS zLinkKey,
      Region,
      Territory,
      District,
      Sales,
      Invoice
From …;

Table2:
Load
      Region&’|’&Territory&’|’&District AS zLinkKey,
      Region,
      Territory,
      District,
      Revenue,
      Dealer
From …;

Link:
Load
      zLinkKey,
      Region       AS zRegionKey,
      Territory     AS zTerritoryKey,
      District       AS zDistrictKey,
      ‘Table1’     AS Type
Resident Table1;

Drop Fields Region,Territory, District From Table1;

Link:
Load
      zLinkKey,
      Region      AS zRegionKey,
      Territory    AS zTerritoryKey,
      District      AS zDistrictKey,
      ‘Table2’    AS Type
Resident Table2;

Drop Fields Region,Territory, District From Table2;

View solution in original post

5 Replies
vitaliichupryna
Creator III
Creator III

Hi Deepak,

See script below:

Table1:
Load
      Region&’|’&Territory&’|’&District AS zLinkKey,
      Region,
      Territory,
      District,
      Sales,
      Invoice
From …;

Table2:
Load
      Region&’|’&Territory&’|’&District AS zLinkKey,
      Region,
      Territory,
      District,
      Revenue,
      Dealer
From …;

Link:
Load
      zLinkKey,
      Region       AS zRegionKey,
      Territory     AS zTerritoryKey,
      District       AS zDistrictKey,
      ‘Table1’     AS Type
Resident Table1;

Drop Fields Region,Territory, District From Table1;

Link:
Load
      zLinkKey,
      Region      AS zRegionKey,
      Territory    AS zTerritoryKey,
      District      AS zDistrictKey,
      ‘Table2’    AS Type
Resident Table2;

Drop Fields Region,Territory, District From Table2;

deepak_km9886
Creator
Creator
Author

I tried it, but the problem is tables are from SQL Server!!I'm getting error in Link table! Can u write the sample script and show it. It'll be helpful

vitaliichupryna
Creator III
Creator III

Please show me you script

deepak_km9886
Creator
Creator
Author

Thanks mate for the  answer!!