Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting Help

Hi All,

I have the below two tables in Script

Table A:

Header 1Header 2
AFile1
BFile2
C

File3

Table B:

Header 11
A
B

The values in column Header1 and Header11 are same.

In the script itself, I want a third table as below. This table would contain the values which are not matching between Table A and Table B.

Output:

Header 1Header 2
C

File3

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

TableA:
Load * Inline [
Header 1,Header 2
A,File1
B,File2
C,File3 ]
;


TableB:
Load * Inline [
Header 11
A
B ]
;


Final:
NoConcatenate
Load [Header 1] As H1,[Header 2] As H2 Resident TableA Where Not Exists([Header 11],[Header 1]);

View solution in original post

6 Replies
anbu1984
Master III
Master III

TableA:
Load * Inline [
Header 1,Header 2
A,File1
B,File2
C,File3 ]
;


TableB:
Load * Inline [
Header 11
A
B ]
;


Final:
NoConcatenate
Load [Header 1] As H1,[Header 2] As H2 Resident TableA Where Not Exists([Header 11],[Header 1]);

shambhub
Creator
Creator

Hi Asma,

Please refer the below script

Table1:

Load * Inline [

Header1, Header2

A, File1

B, File2

C, File3

];

Table2:

Load * Inline [

Header11

A,

B

];

Output:

Load Header1 as D1, Header2 as D2 Resident

Table1 Where Not Exists (Header11,Header1);

Best Regards

Shambhu B

Mahamed_Qlik
Specialist
Specialist

Hi Anbu,

Could please explain the use of NoConcatenate in above given script ?
Even if the result is getting without using it.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using Exists() in Load script

TableA:

Load * Inline [

Header 1,Header 2

A,File1

B,File2

C,File3];

TableB:

Load * Inline [

Header 11

A

B];

Final:

NoConcatenate

Load [Header 1] AS Header1,

[Header 2]  AS Header2

Resident TableA

Where Not Exists([Header 11],[Header 1]);

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

In qlikview if two tables having same columns then this tables will be automatically concatenated, to prevent this we need to use NoConcatenate keyword before load statement.

Hope this helps you.

Regards,

Jagan.

anbu1984
Master III
Master III

Tables will get concatenated if they have exactly same field names and number of columns. Initially I wrote the script with Final table having same field names as Table1 and result got concatenated.


Since field names are changed in Final table, NoConcatenate is not required in this case.