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

add 1 or 2 columns into the load commands

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.

8 Replies
MK9885
Master II
Master II

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


Anonymous
Not applicable
Author

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.

MK9885
Master II
Master II

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.

Anonymous
Not applicable
Author

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);

Mark_Little
Luminary
Luminary

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

Anonymous
Not applicable
Author

Ya its working by giving alias.

Thanks.

Anonymous
Not applicable
Author

Aron,Thanks for the reply.

I will try this.

MK9885
Master II
Master II

Yes, I forgot about changing the name.