Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables:
Event | CustomerID |
StockRequest | 25490 |
StockRequest | 25941 |
PlaceOrder | 25490 |
StockRequest | 25490 |
CustomerID | SalesPersonID | Commission |
25490 | S347 | 10% |
25491 | S348 | 10% |
And I'm trying to combine them so it looks like:
Event | CustomerID | SalesPersonID | Commission |
StockRequest | 25490 | S347 | 10% |
StockRequest | 25941 | S348 | 10% |
PlaceOrder | 25490 | S347 | 10% |
StockRequest | 25490 | S347 | 10% |
But I'm not sure which join to use, and it seems like left join right now is giving me:
Event | CustomerID | SalesPersonID | Commission |
StockRequest | 25490 | S347 | 10% |
StockRequest | 25941 | S348 | 10% |
PlaceOrder | 25490 | - | - |
StockRequest | 25490 | S347 | 10% |
I always get it confused
just Fix table 2, i think
CustomerID | SalesPersonID | Commission |
25490 | S347 | 10% |
25491 ->25941 | S348 | 10% |
Script is right join:
Table1:
LOAD * INLINE [
Event, CustomerID
StockRequest,25490
StockRequest,25941
PlaceOrder,25490
StockRequest,25490
];
right join
LOAD * INLINE [
CustomerID, SalesPersonID, Commission
25490, S347, 10%
25941, S348, 10%
];
output :
Seems like I typed the value wrong in the question, they match up in the actual data. Thank you!