Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join different tables

Hello, everyone!

I have two tables:

Table A: 

OrderCodeWeight
1244224
2244228
32442354
4244222
5244254
625521500
72552980

Table B: 

CodeFreight
24425000
255210000

And I would like to join these tables and from these generate a new one (where I will share the Freight iqually), like that:

OrderCodeWeightFreight
12442241000
22442281000
324423541000
42442221000
52442541000
6255215005000
725529805000

Do you guys know how could I handle with it?

Sincerely, Luiz Bisco

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD Order,

    Code,

    Weight

FROM

[https://community.qlik.com/thread/222452]

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

Join (Table)

LOAD Code,

  Count(Code) as Count

Resident Table

Group By Code;

Left Join (Table)

LOAD Code,

    Freight

FROM

[https://community.qlik.com/thread/222452]

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

FinalTable:

LOAD Order,

  Code,

  Weight,

  Freight/Count as Freight

Resident Table;

DROP Table Table;

View solution in original post

4 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

Just a quick kinda solution:

You can use Mapping LOAD:

Capture.PNG

and the data model will look like the below:

Capture.PNG

Hope this helps.

sunny_talwar

Try this:

Table:

LOAD Order,

    Code,

    Weight

FROM

[https://community.qlik.com/thread/222452]

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

Join (Table)

LOAD Code,

  Count(Code) as Count

Resident Table

Group By Code;

Left Join (Table)

LOAD Code,

    Freight

FROM

[https://community.qlik.com/thread/222452]

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

FinalTable:

LOAD Order,

  Code,

  Weight,

  Freight/Count as Freight

Resident Table;

DROP Table Table;

Not applicable
Author

Thank you, Sunny! It works here!

Not applicable
Author

Sinan, thank you for help me!

I really appreciate it!