Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, do we have the option to load the column data from one table to another table?
Section01:
[POSTAL DATA]:
LIB CONNECT TO HIVEODBC;
LOAD ID,
Postcode,
Postdesc,
Sate,
StateDesc;
SQL SELECT ID,
Postcode,
Postdesc,
Sate,
StateDesc
FROM HIVE.POSTTAB;
Section2:
[KMLFile]:
LOAD ID,
SADIGIT,
LONG,
LAT
FROM [lib://kmlfile/kmlfile.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
( Now as per the above, the two tables gets Join with ID) Here, I want to load the Postcode, Postdesc into the section2 (KMLFile] Table as well, how to achieve it.
Output should be:
[POSTAL DATA] : (ID,Postcode,Postdesc,State,StateDesc) Colums
[KMLFile]: (ID,SADIGIT,LONG,LAT,Postcode,Postdesc), ( 2 (Postcode,Postdesc) columns from [POSTAL DATA] should add to this [KMLFile] Table).
Rams.
Maybe below?
[POSTAL DATA]:
LIB CONNECT TO HIVEODBC;
LOAD ID,
Postcode,
Postdesc,
Sate,
StateDesc;
SQL SELECT ID,
Postcode,
Postdesc,
Sate,
StateDesc
FROM HIVE.POSTTAB;
[KMLFile]:
LOAD ID,
SADIGIT,
LONG,
LAT
FROM [lib://kmlfile/kmlfile.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
Left join ([KMLFile])
Load
LOAD ID,
Postcode,
Postdesc
Resident [POSTAL DATA];
Depending on your Data inside you can do join... to learn more check the below link
Different Join Functions in Qlikview
Aehman, Thanks for the response.
I Think Left Join([POSTAL DATA]) right?
as below
[POSTAL DATA]:
LIB CONNECT TO HIVEODBC;
LOAD ID,
Postcode,
Postdesc,
Sate,
StateDesc;
SQL SELECT ID,
Postcode,
Postdesc,
Sate,
StateDesc
FROM HIVE.POSTTAB;
[KMLFile]:
LOAD ID,
SADIGIT,
LONG,
LAT
FROM [lib://kmlfile/kmlfile.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
Left join ([POSTAL DATA])
Load
LOAD ID,
Postcode,
Postdesc
Resident [POSTAL DATA];
//Correct me if I'm wrong.
Left join ([KMLFile]) is correct.
Cus you are joining the below table to KML Table not Postal Table.
after join check if the Data is showing correct. If not check the link I gave and do the appropriate join.
You could try a mapping load.
Map_Postcode:
Mapping LOAD ID,
Postcode
FROM HIVE.POSTTAB;
Map_Postdesc:
Mapping LOAD ID,
Postdesc
FROM HIVE.POSTTAB;
Section2:
[KMLFile]:
LOAD ID,
SADIGIT,
LONG,
LAT,
Applymap('Map_Postcode',ID,0) as Postcode,
Applymap('Map_Postdesc',ID,0) as Postdesc,
FROM [lib://kmlfile/kmlfile.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
Hi there.
I would follow the instructions supplied by Aehman K. The join should work, but you would have to alias a the fields you are joining or it will give you problems with your data model.
[POSTAL DATA]:
LIB CONNECT TO HIVEODBC;
LOAD ID,
Postcode,
Postdesc,
Sate,
StateDesc;
SQL SELECT ID,
Postcode,
Postdesc,
Sate,
StateDesc
FROM HIVE.POSTTAB;
[KMLFile]:
LOAD ID,
SADIGIT,
LONG,
LAT
FROM [lib://kmlfile/kmlfile.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
Left join ([KMLFile])
Load
LOAD ID,
Postcode AS KML_Postcode,
Postdesc AS KML_Postdesc
Resident [POSTAL DATA];
Mark
Ya its working by giving alias.
Thanks.
Aron,Thanks for the reply.
I will try this.
Yes, I forgot about changing the name.