Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

My link table have $syn key

Hi All

I have a data model , which i already created the link table key. but i don't know how to remove the syn key.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author


Hi Paul,

Added fields bac to your model.

Here it is your final model: and new code:

 

// New code from Jaswant
Drop Table LinkTable;

LinkTable:
LOAD
Date & '|' & [Ref. No_] & '|' & [Key_I] as Link_Key1,
Date as Date
Resident Inquiry1;

Concatenate [LinkTable]:
LOAD Distinct
Date as Date,
Date & '|' & [Ref. No] & '|' & [Key_Q] as Link_Key2
Resident Quotation;

Inquiry2:
NoConcatenate
LOAD
Date & '|' & [Ref. No_] & '|' & [Key_I] as Link_Key1,
*
Resident Inquiry1;


//RENAME Table Inquiry2 to Inquiry1;

Quotation1:
NoConcatenate
LOAD
Date & '|' & [Ref. No] & '|' & [Key_Q] as Link_Key2,
*
Resident Quotation;


//RENAME Table Quotation1 to Quotation;


Drop Tables Quotation, Inquiry1;

Drop field Date from Quotation1, Inquiry2;

View solution in original post

28 Replies
Not applicable
Author

Enclosed my QV doc

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

you could concatenate the fields to create the key you want

jagan
Luminary Alumni
Luminary Alumni


Hi Paul,

Concatenate the Synthetic key fields in Link table and form a key and do the same in other tables.  Now rename the synthetic key field names in link table, so that it avoids Synthetic keys.

Regards,

Jagan.

Not applicable
Author

Hi Sir

I am unable to understand what you mean. can you pls help me show me how to remove them from my QV doc.

Remark :-

For testing , just create folder on C:\TEMP

and copy the unzip into above folder.

Paul

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

try to remove the following fields:

Date and Ref.No_ from the inquiry1 table

Date and Ref.No from the quotation table

Date, Ref.No and Ref.No_ from the linktable

Not applicable
Author

Hi Sir

You ask me to remove the date and Ref no field from Inquiry Table.

My question is if i remove the Date field , may i know am i still able link the date to master calendar , since it deleted?

Are you refer to delete field name at my inquiry script. Since i don't know how to delete field , i try to rename it to another name. will it do the job ?

bbi_mba_76
Partner - Specialist
Partner - Specialist

Yes, you are right, the date field must be in the linktable to join the master calendar.

You could rename the fields or drop them, it is quite the same: if you rename maybe it is easier for debug.

Drop Field

One or several QlikView fields can be dropped from the data model and thus from memory at any time during script execution, by means of a drop field statement.
The syntax is:

drop field[ s ] fieldname [ , fieldname2 ...] [from tablename1 [ , tablename2 ...]]

Both drop field and drop fields are allowed forms with no difference in effect.
If no table is specified, the field will be dropped from all tables where it occurs.

Examples:

drop field A;

drop fields A,B;

drop field A from X;

drop fields A,B from X,Y;

Not applicable
Author

Hi MBA

I have try to rename both Quotation and Inquiry table ref no and date field to diff name.

Now my issue is link table , what should i do ? which i believe i need to do some thing on the link table , in order to drop the syn key.

remove syn key.png

bbi_mba_76
Partner - Specialist
Partner - Specialist

Sorry, I wasn't so clear...

In the linktable you should have only Date, Key_I and Key_Q

In this way with the Date field you join the MasterCalendar, with Key_I the inquiry table and Key_Q the Quotation table.