Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When i reload the following script :
1)keys are generated .So how to resolve it
2) and after resolving the keys how to identify data of a perticular table.
Purchase:
LOAD [Purchase Invoice],
[Purchase Date],
SCCode,
[Purchase Amount],
Location ,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is Purchase);
Sales:
LOAD [Sales Invoice],
[Sales Date],
SCCode,
[Sales Amount],
Location,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is Sales);
[SC Master]:
LOAD SCCode,
Name,
Type,
Location,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is [SC Master]);
Hi,
To resolve synthetic key first identify which field gives you unique combination with distinct data.
Try below code
Purchase:
LOAD [Purchase Invoice],
[Purchase Date],
SCCode,
[Purchase Amount],
Location as Purchase_Location,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is Purchase);
Sales:
LOAD [Sales Invoice],
[Sales Date],
SCCode,
[Sales Amount],
Location as Sales_Location,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is Sales);
[SC Master]:
LOAD SCCode,
Name,
Type,
Location,
FROM
Try_Data.xlsx
(ooxml, embedded labels, table is [SC Master]);
Regards
Please see the attached
In your qvw file synthetic key is generted because of two fileds i.e SCCode and Location rename them in any of the table i shown in below code
Purchase:
LOAD [Purchase Invoice],
[Purchase Date],
SCCode,
[Purchase Amount],
Location
FROM
(
Location:
LOAD Location,
[Location Name],
State
FROM
(
sales:
LOAD [Sales Invoice],
[Sales Date],
SCCode,
[Sales Amount],
Location as location // rename the filed
FROM
(
scmaster:
LOAD SCCode as SC_code, // rename the field
Name,
Type,
Location
FROM
(
You should consider using a composite key for convenience. I would usually avoid synthetic keys unless necessary. Possibly for your sales and purchase it could be subset of SCCODE and Location. I am not too sure what you are trying to achieve but i hope this helps.
http://www.analyticsvidhya.com/blog/2014/11/synthetic-keys-qlikview-simplified/
Hi Gaurav
Use the following statement
QUALIFY Location;
this will not make the synthetic key and qualify the location field as purchase.loaction and sales.location etc
HTH