Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Join a table without increasing lines, but columns instead

Hello,

I have these 2 tables and would like to obtain the result table.

Table1:
IDName
1A
2B
3C

Table2:
IDCompanyField1
11000X
12000Y
21000X
22000Z
32000Y

Result:
IDNameComp.1000Comp.2000
1AXY
2BXZ
3CY

I hope anyone can help. Thanks

1 Solution

Accepted Solutions

Re: Join a table without increasing lines, but columns instead

Try:

Result:

load ID, Name

from ...table1source...;

join

Load ID, Field1 as Comp1000

from ...table2source...

where Company = 1000;

join

Load ID, Field1 as Comp2000

from ...table2source...

where Company = 2000;


talk is cheap, supply exceeds demand
3 Replies

Re: Join a table without increasing lines, but columns instead

Try:

Result:

load ID, Name

from ...table1source...;

join

Load ID, Field1 as Comp1000

from ...table2source...

where Company = 1000;

join

Load ID, Field1 as Comp2000

from ...table2source...

where Company = 2000;


talk is cheap, supply exceeds demand
Not applicable

Re: Join a table without increasing lines, but columns instead

try to use generic load

*************************************

try this

Table1:

load * Inline [

ID,    Name

1,    A

2,    B

3,    C

];

join

Table2:

load * Inline [

ID,    Company,    Field1

1,    1000,    X

1,    2000,    Y

2,    1000,    X

2,    2000,    Z

3,    2000,    Y

];

Generic LOAD ID,'Comp.' & Company ,Field1 Resident Table1;

Generic LOAD ID,'Comp.' &Company ,Field1 Resident Table1;

er_mohit
Honored Contributor II

Re: Join a table without increasing lines, but columns instead

see the attached file

output like this

IDNameComp1000Comp2000
1AXY
2BXZ
3C-Y
Community Browser