Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, everyone!
I have two tables:
Table A:
Order | Code | Weight |
---|---|---|
1 | 2442 | 24 |
2 | 2442 | 28 |
3 | 2442 | 354 |
4 | 2442 | 22 |
5 | 2442 | 54 |
6 | 2552 | 1500 |
7 | 2552 | 980 |
Table B:
Code | Freight |
---|---|
2442 | 5000 |
2552 | 10000 |
And I would like to join these tables and from these generate a new one (where I will share the Freight iqually), like that:
Order | Code | Weight | Freight |
---|---|---|---|
1 | 2442 | 24 | 1000 |
2 | 2442 | 28 | 1000 |
3 | 2442 | 354 | 1000 |
4 | 2442 | 22 | 1000 |
5 | 2442 | 54 | 1000 |
6 | 2552 | 1500 | 5000 |
7 | 2552 | 980 | 5000 |
Do you guys know how could I handle with it?
Sincerely, Luiz Bisco
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;
Hi,
Just a quick kinda solution:
You can use Mapping LOAD:
and the data model will look like the below:
Hope this helps.
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;
Thank you, Sunny! It works here!
Sinan, thank you for help me!
I really appreciate it!