Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Concatenate two tables and just replacing a specified column

Hello Experts,

I am starting to learn concatenate function in Qlikview and I want to replace column f2 from table 2 into table 1

so the intended result as the following table:

f1f2f3
aac4
bbc5
cbc6
dbc2
ecc3

table2:

f1f2f3
aac1
dbc2
ecc3

table1:

f1f2f3
abc4
bbc5
cb

c6

I used the code below and the result table turn out to be this:

f1f2f3
aac1
abc4
bbc5
cbc6
dbc2
ecc3

LOAD f1,

     f2,

     f3

FROM

C:\table1.xlsx

(ooxml, embedded labels, table is Sheet1);

Concatenate

LOAD f1,

     f2,

     f3

FROM

C:\table2.xlsx

(ooxml, embedded labels, table is Sheet1);

PLEASE HELP!!! THANKS IN ADVANCE!!

14 Replies
MVP
MVP

Re: Concatenate two tables and just replacing a specified column

Try something like:

LOAD f1,

     f2,

     f3

FROM

C:\table1.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD f1,

     f2,

     f3

FROM

C:\table2.xlsx

(ooxml, embedded labels, table is Sheet1)  where not exists(f1);  

Not applicable

Re: Concatenate two tables and just replacing a specified column

hi

try this code.

table2:

LOAD * Inline [

f1,    f2,    f3

a,    a,    c1

d,    b,    c2

e,    c,    c3

]   ;

Join

table1:

LOAD * Inline [

f1,    f2,    f3

a,    b,    c4

b,    b,    c5

c,    b, c6] Where not Exists(f1);


then output like this

f1f2f3
aac1
bbc5
cbc6
dbc2
ecc3

see attached file.

nizamsha
Valued Contributor

Re: Concatenate two tables and just replacing a specified column

table2:

LOAD * Inline [

f1, f2, f3

a, a, c1

d ,b, c2

e ,c, c3

];

table1:

LOAD * Inline [

f1 ,f2, f3

a ,b ,c4

b ,b, c5

c ,b ,c6

]  where not exists(f1);

sujeetsingh
Honored Contributor III

Re: Concatenate two tables and just replacing a specified column

It seems some time the user posting the issue just forget to mention what is right and helpful.

Not applicable

Re: Concatenate two tables and just replacing a specified column

Hello Dear,

Using when not exists(f1) statement in the end I get this table:

f1f2f3
abc4
bbc5
cbc6
dbc2
ecc3

which is not the one I am hoping to get...

I want to get this result:

f1f2f3
aac4
bbc5
cbc6
dbc2
ecc3
Not applicable

Re: Concatenate two tables and just replacing a specified column

Hello Dear,

Using when not exists(f1) statement in the end I get this table:

f1f2f3
abc4
bbc5
cbc6
dbc2
ecc3

which is not the one I am hoping to get...

I want to get this result:

f1f2f3
aac4
bbc5
cbc6
dbc2
ecc3
Not applicable

Re: Concatenate two tables and just replacing a specified column

f1f2f3
aac4
bbc5
cbc6
dbc2
ecc3

Thanks for the help, but this is the table I was trying to get...

PLEASE HELP!!

nizamsha
Valued Contributor

Re: Concatenate two tables and just replacing a specified column

LOAD * Inline [

f1, f2, f3

a, a, c1

d ,b, c2

e ,c, c3

] where not exists(f1);

table1:

LOAD * Inline [

f1 ,f2, f3

a ,b ,c4

b ,b, c5

c ,b ,c6

]  ;

MVP
MVP

Re: Concatenate two tables and just replacing a specified column


Then Try:

LOAD f1,

     f2,

     f3

FROM

C:\table2.xlsx

(ooxml, embedded labels, table is Sheet1) ;  

LOAD f1,

     f2,

     f3

FROM

C:\table1.xlsx

(ooxml, embedded labels, table is Sheet1)  where not exists(f1);

Community Browser