Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

Concatenation two tables from one data source

I have one table that I am trying to concatenate to itself basically with just one additional manually defined field.  Here is the table structure:

Table1:

LOAD MonthNum,

          Account,

          Cost,

          '2016' AS Year

FROM

(ooxml, embedded labels, table is Sheet1);

I then want to add data from another file (Table2.xlsx) that has the same fields except for the Year.  What is the best way to do this?  I would like to use a QVD if possible.

1 Solution

Accepted Solutions
bgerchikov
Partner - Creator III
Partner - Creator III

Hi Cliff,

You can use either Join command or Concatenate:

Table1:

LOAD MonthNum,

          Account,

          Cost,

          '2016' AS Year

FROM

(ooxml, embedded labels, table is Sheet1);

Store Table1 into Table1.qvd();

Join(Table1)

Load *

FROM
[Table1.qvd]
(
qvd)

Join(Table1)

LOAD MonthNum,

          Account,

          Cost

FROM

(ooxml, embedded labels, table is Sheet1);

View solution in original post

2 Replies
bgerchikov
Partner - Creator III
Partner - Creator III

Hi Cliff,

You can use either Join command or Concatenate:

Table1:

LOAD MonthNum,

          Account,

          Cost,

          '2016' AS Year

FROM

(ooxml, embedded labels, table is Sheet1);

Store Table1 into Table1.qvd();

Join(Table1)

Load *

FROM
[Table1.qvd]
(
qvd)

Join(Table1)

LOAD MonthNum,

          Account,

          Cost

FROM

(ooxml, embedded labels, table is Sheet1);

maxgro
MVP
MVP

You can add the Table2 rows to Table1 using a concatenate

concatenate (Table1)

LOAD MonthNum,

          Account,

          Cost

FROM

(ooxml, embedded labels, table is Sheet1);