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

Join Tables together top to bottom

Hi

I have 2 tables that link with a common record ID key. I need to join them so I have one table with the 3 fields. The field names are not important, what is important is that I require the data to be stacked on top of one another instead of side by side like below...

Table A:

ID               Name              Number

1                 p1                    7338

1                 p2                    7339

1                 p3                    7340

40               p1                    22001

40               p2                    22002

46               p3                    22003

Table B:

ID               PrimaryN         EVID

1                 Shp1-p3          8871

40               Shp50-p60      23055

46               Shp22-p23      26001

What I get when I join them in QlikView:

ID               Name              Number               PrimaryN            EVID

1                 p1                    7338                   Shp1-p3              8871

1                 p2                    7339                   Shp1-p3              8871

1                 p3                    7340                   Shp1-p3              8871

40               p1                    22001                 Shp50-p60          23055

40               p2                    22002                 Shp50-p60          23055

46               p3                    22003                 Shp22-p23          26001

What I actually want the result to be:

ID               Full Name        EV-Number

1                 p1                    7338

1                 p2                    7339

1                 p3                    7340

1                Shp1-p3           8871

40               p1                    22001

40               p2                    22002

40              Shp50-p60       23055

46               p3                    22003

46               Shp22-p23      26001

1 Solution

Accepted Solutions
MarcoWedel

Hi,

renaming your fields to common field names while loading will autoconcatenate your tables:

QlikCommunity_Thread_219017_Pic1.JPG

TableA:

LOAD ID,

    Name as [Full Name],

    Number as [EV-Number]

Inline [

ID              Name              Number

1                p1              7338

1                p2              7339

1                p3              7340

40              p1              22001

40              p2              22002

46              p3              22003

] (delimiter is spaces);

TableB:

LOAD ID,

    PrimaryN as [Full Name],

    EVID as [EV-Number]

Inline [

ID              PrimaryN        EVID

1                Shp1-p3          8871

40              Shp50-p60        23055

46              Shp22-p23        26001

] (delimiter is spaces);

hope this helps

regards

Marco

View solution in original post

3 Replies
Not applicable
Author

...Think I just sussed this by using CONCATENANTE:

Union All in QV load script

MarcoWedel

Hi,

renaming your fields to common field names while loading will autoconcatenate your tables:

QlikCommunity_Thread_219017_Pic1.JPG

TableA:

LOAD ID,

    Name as [Full Name],

    Number as [EV-Number]

Inline [

ID              Name              Number

1                p1              7338

1                p2              7339

1                p3              7340

40              p1              22001

40              p2              22002

46              p3              22003

] (delimiter is spaces);

TableB:

LOAD ID,

    PrimaryN as [Full Name],

    EVID as [EV-Number]

Inline [

ID              PrimaryN        EVID

1                Shp1-p3          8871

40              Shp50-p60        23055

46              Shp22-p23        26001

] (delimiter is spaces);

hope this helps

regards

Marco

Not applicable
Author

Marco, thanks for sharing that...it works just as well