Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

About $syn


i m trying import the excels of 3 4 tables and i m getting $syn fields and tables created, i have tried concatenate but becuase of concatenate is there any diffrence in the result of join with syn table and with concatenate command?

Please can any one tell me that?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use the script from the attached file.

Celambarasan

View solution in original post

24 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

Syn table is created because there are more than one field common in your tables.


If your primary key is more than one field  then create a concatenated key by using Col1&Col2... and alias the col1 and col2 in any one table. Now you dont have more than one column common so it wont show u syntehetic key.

Hope this will help you.

Not applicable
Author

hi,

When you do not specify map conditions, QV will automatically map the fields with same name and make $syn key.

The tables are then mapped with the help of these $syn keys,

but in concatinate and join. syn key is not created but the whole table is merged into one.

In join the matched fields which have same records are merged into one record, i.e no duplicacy.

But in Concatenate, the tableis simply append below another.

Example:

We have two table

A and B

A.PNGB.PNG

now when we do not use join or concatinate , it will create &syn key:

syn.PNG

in join, matching records of common fiels(x and A) will be merged

The result is:

join.PNG

in concatinate , the records are append to the table, a1 a2 a3 will not mapped in this case:

concatinate.PNG

Here is this example attached, hope it help you:

Regards,

Arun Goel

Not applicable
Author

ok arun i dont wnt duplicacy in my case.

Do you know how to join the tables?

Not applicable
Author

hi,

just use JOIN keyword between two load statements.

Not applicable
Author

You can also use QUALIFY and UNQUALIFY to map selected fields of your choice.

Not applicable
Author

Hi Arun,

Thanks for your help.

I tried the qualify but I didn’t get correct result what is syntax I means do we need to add only the command qualify or something else?

jagannalla
Partner - Specialist III
Partner - Specialist III

Qualify *;

UnQualify ID;

Table1:

Load

     ID,

     A,B,C

From T1.qvd;

UnQualify ID;

Table2:

Load

     ID,

     A1,B1,C1

From T2.qvd;

UnQualify *;

Not applicable
Author

hi,

Suppose in my example, you want to map only field A then:

USE:

QUALIFY *;

UNQUALIFY A;

LOAD * INLINE [

    x, A, B, C

    1, a1, b1, c1

    2, a2, b2, c2

    3, a3, b3, c3

    4, a4, b4, c4

    5, a5, b5, c5

    6, a6, b6, c6

];

QUALIFY *;

UNQUALIFY A;

LOAD * INLINE [

    x, A, D, E

    Co, a1, b1, c1

    2, a2, b2, c2

    3, a3, b3, c3

    7, a7, b7, c7

    8, a8, b8, c8

    9, a9, b9, c9

];

The result will be:

qualify.PNG

See the attached file:

Not applicable
Author

Ok thanks, I will try it.