Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have been working on making a data model for the northwind database. i am stuck at a point of removing synthetic keys. the thing is i don't know exactly about the composite key. can anyone please tell how to apply composite key and what should be its syntax?
Then load a script like
Sol:
Tab1:
Country&'-'&Region as Key //Composite key,
Country as Tab1_Country,
Region as Tab1_Region
Sales,
Products
From --------------;
Tab2:
Country&'-'&Region as Key //Composite key,
Country as Tab2_Country,
Region as Tab2_Region
Customer,
Outstanding
From --------------;
Rename this two fields in the table
You can rename those fields
ex:
In Tab1:
Country as Tab1_Country
Region as Tab1_Region
In Tab2:
Country as Tab2_Country
Region as Tab2_Region
or
You can keep Country and Region as it is from any one table.
Now all your fields are unique except Key field(composite key) and relation ship exists between your 2 tables based on this
Hi,
Tab1 & Tab2 both are common field. i want select common single column in listbox.
Regards,
Muni
In Tab1 & Tab2 not all fields are common in above suppose they are same
Eg:-
Tab1:
Country&'-'&Region&'-'&Sales as Key //Composite key,
//Country as Tab1_Country,
//Region as Tab1_Region
//Sales
From --------------;
Tab2:
Country&'-'&Region&'-'&Sales as Key //Composite key,
//Country as Tab2_Country,
//Region as Tab2_Region
//Sales,
From --------------;
After loading this two tables concatenate to each other and give single table with key field
i want county,region,sales field in list.
user want select list box to filter purpose.
Please check enclosed file having dummy data which can help to understand how synthetic key/table can be removed using Link Table approach.
UPDATE : You can check the table structure by CTRL + T
Hope this helps...
http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys
I like synthetic keys in some circumstances. As long as I have planned to use them. For example I joined the three main tables together in a service company using a synthetic key
The call table (call_num) and field service visit table number (call_Num & FSR_Num) with the revenue charges lines (call_Num & FSR_Num & FSRL_Num)
This was tidier and the saved file was smaller than when I used a composite key
Hi Anand,
I have got nothing common from the table which i want to add in Data model.Can u help as how to use Composite key on that.Same data as in discussion.
Table Name:Sales Reports
Fields:ID,Display,GroupBy,Title,Filterrowsource.
Hi ,
Is it necessary to add any separation symbol in between?
For example in your case you are using the separation symbol "-".
What if I directly create the key as -
Sol:
Tab1:
Country&Region as Key //Composite key
Sales
Products
From --------------;
Tab2:
Country&Region as Key //Composite key
Customer,
Outstanding
From --------------;
Regards,
Mahamed