Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

(Another) Table transformation

Hello Community!

I have two tables that I would like to join in a third table:

Table A

Header 1Header 2
BS000022
BS000023
BS010026

Table B

Header 2Type
22Head
2200Posting
2210Posting
23Head
2300Posting
2310Posting
2320Posting
26Head
2600Posting
2650

Posting

Result table:

Header 1Header 2
BS00002200
BS00002210
BS00002300
BS00002310
BS00002320
BS01002600
BS01002650

The link are the values under "Header 2" in TableA, but they do not have to appear in result table.

The values under 22, 23 and 26 with "Posting" are the ones to appear.

Any help will be highly appreciated! Many thanks in advance.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

t1:

LOAD

  [Header 1],

    [Header 2] as joinfield

FROM

[http://community.qlik.com/thread/115632]

(html, codepage is 1252, embedded labels, table is @1);

t2:

LOAD

  [Header 2],

  left([Header 2], 2) as joinfield,

    Type

FROM

[http://community.qlik.com/thread/115632]

(html, codepage is 1252, embedded labels, table is @2)

where Type = 'Posting';

View solution in original post

5 Replies
maxgro
MVP
MVP

t1:

LOAD

  [Header 1],

    [Header 2] as joinfield

FROM

[http://community.qlik.com/thread/115632]

(html, codepage is 1252, embedded labels, table is @1);

t2:

LOAD

  [Header 2],

  left([Header 2], 2) as joinfield,

    Type

FROM

[http://community.qlik.com/thread/115632]

(html, codepage is 1252, embedded labels, table is @2)

where Type = 'Posting';

MK_QSL
MVP
MVP

Table1:

Load

  [Header 1],

  [Header 2] as Flag Inline

[

  Header 1, Header 2

  BS0000, 22

  BS0000, 23

  BS0100, 26

];

Join

Load

  [Header 2],

  Left([Header 2],2) as Flag,

  Type

Inline

[

  Header 2, Type

  22, Head

  2200, Posting

  2210, Posting

  23, Head

  2300, Posting

  2310, Posting

  2320, Posting

  26, Head

  2600, Posting

  2650, Posting

] Where Type <> 'Head';

salto
Specialist II
Specialist II
Author

Thank you both Massimo and Manish!

MK_QSL
MVP
MVP

I think Massimo Grossi's answer is also correct and he has answered before me, so better if you select his answer as Correct and my one as Helpful.

This could be a true justice to his work also.

salto
Specialist II
Specialist II
Author

Hi Manish,

done as requested. You are totally right.

Sorry Massimo for my mistake, and thank you both again.