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: 
clsaulsberry
Contributor III
Contributor III

script help

I have 3 tables

table 1

hub, order number, carton number, sku

table 2

hub, order_header_key, order number, sku, work order,

table 3

order_header_key, order number, work order, return number

I need to query for the below only if it is with criteria for certain hubs

order number, carton number, sku, work order, return number -  only if it is in table 1

any help would be appreciated

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Can you elaborate below a little more clearly please...

I need to query for the below only if it is with criteria for certain hubs

order number, carton number, sku, work order, return number -  only if it is in table 1


May be you can try below:

Table1:

LOAD *, hub&OrdNo&SKU As HubKey;

LOAD hub,

     [Order Number]  AS OrdNo,

     [Carton Number] AS CartNo,

     SKU

FROM Table1;

NoConcatenate

table2:

LOAD hub               AS hub2,

     order_header_key,

     [order number]    AS OrdNo2,

     sku               AS sku2,

     [work order]      AS WorkOrd2

FROM table2;

LEFT JOIN(table2)

table3:

LOAD order_header_key,

     [order number]  AS OrdNo2,

     [work order]    AS WorkOrd2,

     [return number] AS ReturnNo3

FROM table3;

NoConcatenate

Final:

LOAD *, hub2&OrdNo2&sku2 AS HubKey

Resident table2

WHERE Exists(HubKey, hub2&OrdNo2&sku2);

Drop Table table2;

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

Can you elaborate below a little more clearly please...

I need to query for the below only if it is with criteria for certain hubs

order number, carton number, sku, work order, return number -  only if it is in table 1


May be you can try below:

Table1:

LOAD *, hub&OrdNo&SKU As HubKey;

LOAD hub,

     [Order Number]  AS OrdNo,

     [Carton Number] AS CartNo,

     SKU

FROM Table1;

NoConcatenate

table2:

LOAD hub               AS hub2,

     order_header_key,

     [order number]    AS OrdNo2,

     sku               AS sku2,

     [work order]      AS WorkOrd2

FROM table2;

LEFT JOIN(table2)

table3:

LOAD order_header_key,

     [order number]  AS OrdNo2,

     [work order]    AS WorkOrd2,

     [return number] AS ReturnNo3

FROM table3;

NoConcatenate

Final:

LOAD *, hub2&OrdNo2&sku2 AS HubKey

Resident table2

WHERE Exists(HubKey, hub2&OrdNo2&sku2);

Drop Table table2;

clsaulsberry
Contributor III
Contributor III
Author

i am trying to get the work order number and return number for only the items i have in table 1.

i hope that makes more sense

vishsaggi
Champion III
Champion III

Can you share some sample data and what your final table should look like?