Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Combining Tables

Hey,

I have a problem with combining two tables which I have as QVD-Files.

For better understanding I create these two tables:

Table1:

LOAD * INLINE [

    Auftr,      KdNr

    1,           aa,

    2,           cc,

    3,           ee,

];

Table2:

LOAD * INLINE [

    Auftr,      LSNr,      Date

    1,           xx,           10,

    1,           zz,           12,

    3,           yy,           11,

];

What I want to have is a new table with the following content:

AuftrNr,KdNr,LsNr,Date
1,aa,--,--,
1,aa,xx,10,
1,aa,zz,12,
2,cc,--,--,
3,ee,--,--,
3,ee,yy,11,

I tried many different join as well as concatenate approaches but never got the correct result.

Can someone help me?

BR,

Emanuel

1 Solution

Accepted Solutions
Highlighted

Can be simplified to this

Table1:

LOAD * INLINE [

    Auftr,      KdNr

    1,          aa,

    2,          cc,

    3,          ee,

];

Join (Table1)

LOAD * INLINE [

    Auftr,      LSNr,      Date

    1,          xx,          10,

    1,          zz,          12,

    3,          yy,          11,

];

Concatenate (Table1)

LOAD DISTINCT Auftr,

  KdNr

Resident Table1;

DROP Table Table2;

View solution in original post

12 Replies
Highlighted

May be like this:

Table1:

LOAD * INLINE [

    Auftr,      KdNr

    1,          aa,

    2,          cc,

    3,          ee,

];

Table2:

LOAD * INLINE [

    Auftr,      LSNr,      Date

    1,          xx,          10,

    1,          zz,          12,

    3,          yy,          11,

];

Join (Table1)

LOAD *

Resident Table2;

Concatenate (Table1)

LOAD DISTINCT Auftr,

  KdNr

Resident Table1;

DROP Table Table2;

Capture.PNG

Highlighted
Creator III
Creator III

Use just join

I have attach example

Highlighted
Specialist
Specialist

Hi sunny,

could you please elaborate above solution.its bit confusion for me..

Thanks,

surendra

Highlighted

Elaborate what? What part of the script do you not understanding? Its seems like a straight forward script, unless you have specific thing you don't understand

Best,

Sunny

Highlighted

Can be simplified to this

Table1:

LOAD * INLINE [

    Auftr,      KdNr

    1,          aa,

    2,          cc,

    3,          ee,

];

Join (Table1)

LOAD * INLINE [

    Auftr,      LSNr,      Date

    1,          xx,          10,

    1,          zz,          12,

    3,          yy,          11,

];

Concatenate (Table1)

LOAD DISTINCT Auftr,

  KdNr

Resident Table1;

DROP Table Table2;

View solution in original post

Highlighted
Contributor III
Contributor III

Hey Anna,

your answer is the easiest to understand for me (sorry I'm a newby  )

But I don't understand the meaning of "1 as flag", can you explain it for me.

Edit:

     Unfortunately, the results are not correct..

Highlighted

But this doesn't seem like its meeting your requirement, is it?

Capture.PNG

vs. this

Capture.PNG

Or the required output had a typo?

Highlighted
Creator III
Creator III

its a flag from which table data are coming, you do not need to use it

Highlighted
Contributor III
Contributor III

You are right, I edited my question!