Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
danm84306-2
Contributor
Contributor

QlikView Concatenation

Hello,

I am looking to append two tables (with the same field names) as one table. I used Concatenate with and without Residents and I still get the same thing...3 rows in each table now turn into six rows. Nothing I have tried worked (I tried every type of join as well)

Test1 Data

Field1 Field2 Field3
R1F1 R1F2 R1F3
R2F1 R2F2 R2F3
R3F1 R3F2 R3F3

 

Test2 Data

Field1 Field2 Field3
R4F1 R4F2 R4F3
R5F1 R5F2 R5F3
R6F1 R6F2 R6F3

 

I want

Field1 Field2 Field3
R1F1 R1F2 R1F3
R2F1 R2F2 R2F3
R3F1 R3F2 R3F3
R4F1 R4F2 R4F3
R5F1 R5F2 R5F3
R6F1 R6F2 R6F3
Labels (1)
7 Replies
Or
MVP
MVP

This seems to work fine with a simple concatenate...

Load * INLINE
[
Field1, Field2, Field3
R1F1, R1F2, R1F3
R2F1, R2F2, R2F3
R3F1, R3F2, R3F3];
CONCATENATE Load * INLINE [
Field1, Field2, Field3
R4F1, R4F2, R4F3
R5F1, R5F2, R5F3
R6F1, R6F2, R6F3];

Or_0-1659023545482.png

If you're not getting the expected results, I'd suggest checking that the field names are indeed identical (including case, spacing, etc). Note that this is still six rows, because it's supposed to be six rows (three from each table).

danm84306-2
Contributor
Contributor
Author

Thank you, I did check this as well. I am doing this as a test with Excel files because I am trying to do this with QVDs and I'm getting the same results. I figured I can test this out to get the syntax down right then apply to my QVW with real data

danm84306-2
Contributor
Contributor
Author

Script

Test1:
LOAD Field1,
Field2,
Field3
FROM
[D:\Qlikview\Development\Test1.xlsx]
(ooxml, embedded labels, table is Sheet1);

Concatenate(Test1)

LOAD Field1,
Field2,
Field3
FROM
[D:\Qlikview\Development\Test2.xlsx]
(ooxml, embedded labels, table is Sheet1);

 

Result:

Sheet1.Field1 Sheet1.Field2 Sheet1.Field3 Test1.Field1 Test1.Field2 Test1.Field3
R4F1 R4F2 R4F3      
R5F1 R5F2 R5F3      
R6F1 R6F2 R6F3      
      R1F1 R1F2 R1F3
      R2F1 R2F2 R2F3
      R3F1 R3F2 R3F3
danm84306-2
Contributor
Contributor
Author

Script with Resident

Test1:
LOAD Field1,
Field2,
Field3
FROM
[D:\Qlikview\Development\Test1.xlsx]
(ooxml, embedded labels, table is Sheet1);

Test2:
LOAD Field1,
Field2,
Field3
FROM
[D:\Qlikview\Development\Test2.xlsx]
(ooxml, embedded labels, table is Sheet1);

Test3:

NoConcatenate

LOAD *

Resident Test1;

Concatenate(Test3)

LOAD *

Resident Test2;

Drop Tables Test2, Test1;

 

Result:

Test2-1.Test2.Field1 Test2-1.Test2.Field2 Test2-1.Test2.Field3 Test3.Test1.Field1 Test3.Test1.Field2 Test3.Test1.Field3
R4F1 R4F2 R4F3      
R5F1 R5F2 R5F3      
R6F1 R6F2 R6F3      
      R1F1 R1F2 R1F3
      R2F1 R2F2 R2F3
      R3F1 R3F2 R3F3
Or
MVP
MVP

An earlier part of your script has Qualify *; in it, seemingly. Either remove that, or use Unqualify *; before these statements to disable it for this part.

danm84306-2
Contributor
Contributor
Author

I commented out QUALIFY

 

Results

Sheet1.Field1 Sheet1.Field2 Sheet1.Field3 Test1.Field1 Test1.Field2 Test1.Field3
R4F1 R4F2 R4F3      
R5F1 R5F2 R5F3      
R6F1 R6F2 R6F3      
      R1F1 R1F2 R1F3
      R2F1 R2F2 R2F3
      R3F1 R3F2 R3F3
danm84306-2
Contributor
Contributor
Author

Here are the two test files, If anyone can create a test QVW with a script that works, please let me know