Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need to make Primary key

I'm a beginner to qlikview.  Have loaded three xlsx file in QVW document, all the three xlsx file have one common field.

However, it is not seen as Primary key.  Also, in the Table viewer, fields like '$Syn1', '$Syn3' are showing

How to remove this 'Syn' field and how to make the common field as primary key

18 Replies
Anonymous
Not applicable
Author

Hi

To remove synthetic keys you can use qualify to prefix the fieldnames with the in memory table name (i.e. change fieldname company in table A to A.company) therefore making the fields unique in the data model. If you have a field named company in table A & B you would end up with A.company and B.company using qualify statement.

Below is a basic example using quality statements:

Qualify company;

Unqualify uniqueID;

The above would prefix the company field with the table name but leave the uniqueID field unaffected so you could use this to associate between tables.

Hope this is useful to you  but you can get more info on Qualify in the forum.

Not applicable
Author

Field names are the same in all files

awhitfield
Partner - Champion
Partner - Champion

Hi Suresh,

things like this are MUCH easier to help with if you SUPPLY an example QVW and sample data files!

HTH

Andy

Not applicable
Author

Hi Andrew,

As suggested, have attached sample files

1)  3 xlsx file with one sample data each.  Common field being 'ScripCode'

2)  QVW file

3)  Snap of Table viewer

Hope this help to understand the issue

Anonymous
Not applicable
Author

Post sample data

Not applicable
Author

Hope the attached file helps to understand the issue.  The common field in xlsx is 'ScripCode'

Not applicable
Author

  Hi Anil,

 

As suggested, have attached sample files

 

1)  3 xlsx file with one sample data each.  Common field being 'ScripCode'

2)  QVW file

3)  Snap of Table viewer

 

Hope this help to understand the issue

 

Not applicable
Author

Hi,

concatenate BSE14 and BSE16.

Then create composite key as ScripCode&Symbol as Key in newly created table and ScpMst table.

reanme this field as table.fieldName if required or comment out if not necessary.

awhitfield
Partner - Champion
Partner - Champion

may be as simple as this:

S14:
LOAD
ScripCode,
//Symbol,
   AvgQtyDec14,
[AvgT/oDec14],
[AvgT/oDec14L],
AvIn16
FROM
S14.xlsx
(
ooxml, embedded labels, table is BSE14);


S16:
LOAD
ScripCode,
// Symbol,
   AvgQtyFeb16,
[AvgT/oFeb16],
[AvgT/oFeb16L]
// AvIn16
FROM
S16.xlsx
(
ooxml, embedded labels, table is BSE16);


SScpmst:
LOAD
ScripCode,
ISIN,
Symbol,
ScripGroup
FROM
SScpmst.xlsx
(
ooxml, embedded labels, table is ScpMst);

Gives:

Andy