Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How I can unite tables in script?

Good Day!

I need help. I have 2 tables, that I load from SQL base (Table 1 and Table 2). I need to get in script Result Table 3. I need to add to Table 1 rows from Table 2 with values in Field A, that not include in Table 1. I prepare sample:

Table 1
Field AField B
1A
2B
3C
4D
5E
Table 2
Field AField B
4F
5G
6H
7J
8K
Result Table 3
Field AField B
1A
2B
3C
4D
5E
6H
7J
8K

Thank you.

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi

Please use the below code.

Thank you.

Table1:

LOAD * INLINE [

Field A,Field B

1,A

2,B

3,C

4,D

5,E

];

Concatenate (Table1)

Table2:

LOAD * INLINE [

Field A,Field B

4,F

5,G

6,H

7,J

8,K

] Where Not Exists([Field A]);

View solution in original post

9 Replies
qlikviewwizard
Master II
Master II

Hi Please use the below script.

This will works.

Table1:

LOAD * INLINE [

Field A,Field B

1,A

2,B

3,C

4,D

5,E

];

Concatenate (Table1)

Table2:

LOAD * INLINE [

Field A,Field B

4,F

5,G

6,H

7,J

8,K

];

Capture.JPG

qlikviewwizard
Master II
Master II

Hi pmaxx0108

Please select Correct Answer instead of Helpful and close the thread. Thank you.

MK_QSL
MVP
MVP

Table1:

LOAD * INLINE [

Field A,Field B

1,A

2,B

3,C

4,D

5,E

];

Concatenate (Table1)

Table2:

LOAD * INLINE [

Field A,Field B

4,F

5,G

6,H

7,J

8,K

] Where Not Exists([Field A]);

dclark0699
Creator
Creator

I think you not only want to Concatenate, but you need a WHERE NOT EXISTS to prevent loading where the field A value is in table 1.

Table1:

LOAD * INLINE [

Field A,Field B

1,A

2,B

3,C

4,D

5,E

];

Concatenate (Table1)

Table2:

LOAD * INLINE [

Field A,Field B

4,F

5,G

6,H

7,J

8,K

]

WHERE NOT EXISTS([Field A]);

screencap_55 Jul. 22 11.12.gif

dclark0699
Creator
Creator

Your solution does not eliminate the values that already exist in Field A. Check again at the final results expectation. There is only 1 4 and 1 5 in the Field A. Need to include Where Not Exists

Not applicable
Author

I need only one value 4 and 5 from Field A:

Table 3.png

qlikviewwizard
Master II
Master II

Hi

Please use the below code.

Thank you.

Table1:

LOAD * INLINE [

Field A,Field B

1,A

2,B

3,C

4,D

5,E

];

Concatenate (Table1)

Table2:

LOAD * INLINE [

Field A,Field B

4,F

5,G

6,H

7,J

8,K

] Where Not Exists([Field A]);

Not applicable
Author

Thank you all

qlikviewwizard
Master II
Master II

Hi pmaxx0108

Please close the thread by selecting Correct Answer. Thank you.