Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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
Arjunarao
Honored Contributor II

Re: How I can unite tables in script?

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

9 Replies
Arjunarao
Honored Contributor II

Re: How I can unite tables in script?

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

Arjunarao
Honored Contributor II

Re: How I can unite tables in script?

Hi pmaxx0108

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

Re: How I can unite tables in script?

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
Contributor

Re: How I can unite tables in script?

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
Contributor

Re: How I can unite tables in script?

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

Re: How I can unite tables in script?

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

Table 3.png

Arjunarao
Honored Contributor II

Re: How I can unite tables in script?

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

Re: How I can unite tables in script?

Thank you all

Arjunarao
Honored Contributor II

Re: How I can unite tables in script?

Hi pmaxx0108

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

Community Browser