Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to remove syn table

How can I remove syn table from the following schema

Sans titre.png

Any help would be the most appreciated .

10 Replies
Gysbert_Wassenaar

If you don't experience performance problems then you don't need to remove it. See this blog post: Synthetic Keys


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

define a field with combination from both fields in each table

'Code Structure' & 'Code Rayon' as %CodeStructureRayon

rename both fields at least in one table

or

build a table with both fields and the new created field %CodeStructureRayon

Colin-Albert

Have a look at the links in this post

Data Model

vijetas42
Specialist
Specialist

Hi,

please check whether you need to join these two tables on Code Structure and Code Rayon. If you want to join on any one of the column then just rename the second column with different name.so that ,Your synthetic keys will resolved and from your data model syn table will get removed.

Thanks

Anonymous
Not applicable
Author

I need both Code Structure and Code Rayon

sasiparupudi1
Master III
Master III

use qualify statement

qualify Code Structure,Code Rayon;

sasiparupudi1
Master III
Master III

sorry, forgot to mention , you need the following key field in your tables

'Code Structure' & 'Code Rayon' as %CodeStructureRayon

Karim_Khan
Creator III
Creator III

You can remove the same by renaming the fields or applying the Link table concept.concept. Pls share ur script for better understanding.

KK
Karim_Khan
Creator III
Creator III

You can implement the same throigh below code

DIRECTORY;

Budget:

LOAD// [Customer Number],

//     Year,

//     Month,

     [Budget Amount],

     [Customer Number] &'|'& Year &'|'& Month as LinkKey //Key Field Genrated

    

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Anil.V\Link & Synthetic Key\LinkSamplData.xlsx]

(ooxml, embedded labels, table is Budget);

Sales:

LOAD //[Customer Number], //Common Field has Dropped

//     Year,

//     Month,

     [Sales Amount],

     [Customer Number] &'|'& Year &'|'& Month as LinkKey //Key Field Genrated

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Anil.V\Link & Synthetic Key\LinkSamplData.xlsx]

(ooxml, embedded labels, table is Sales);

Customer:

LOAD [Customer Number],

     [Customer Name]

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Anil.V\Link & Synthetic Key\LinkSamplData.xlsx]

(ooxml, embedded labels, table is Customer);

//Step – 2 Create the Link Table by loading the distinct values of the fact tables

Link:

LOAD Distinct

     [Customer Number] &'|'& Year &'|'& Month as LinkKey ,

     [Customer Number] &'|'& Year &'|'& Month as Duplicate_LinkKey, //For Checking Duplicate combination while Concatenating

     [Customer Number],

     Year,

     Month

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Anil.V\Link & Synthetic Key\LinkSamplData.xlsx]

(ooxml, embedded labels, table is Budget);

Concatenate (Link)

Load Distinct

     [Customer Number] &'|'& Year &'|'& Month as LinkKey, //Concatenate Distinct Combination of Key

     [Customer Number],

     Year,

     Month

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Anil.V\Link & Synthetic Key\LinkSamplData.xlsx]

(ooxml, embedded labels, table is Sales)

WHERE NOT EXISTS(Duplicate_LinkKey, [Customer Number] &'|'& Year &'|'& Month ); //Filter Duplication

DROP Field Duplicate_LinkKey FROM Link;

//Step-3 Load other dimension tables.

KK