Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
shirleyc40
Creator
Creator

Joining two tables and duplicate data

I have two tables: 

EventCustomerID
StockRequest25490
StockRequest25941
PlaceOrder25490
StockRequest25490

 

CustomerIDSalesPersonIDCommission
25490S34710%
25491S34810%

 

And I'm trying to combine them so it looks like:

EventCustomerIDSalesPersonIDCommission
StockRequest25490S34710%
StockRequest25941S34810%
PlaceOrder25490S34710%
StockRequest25490S34710%

 

But I'm not sure which join to use, and it seems like left join right now is giving me: 

EventCustomerIDSalesPersonIDCommission
StockRequest25490S34710%
StockRequest25941S34810%
PlaceOrder25490--
StockRequest25490S34710%

I always get it confused

Labels (1)
2 Replies
Taoufiq_Zarra

@shirleyc40 

just Fix table 2, i think

CustomerIDSalesPersonIDCommission
25490S34710%
25491 ->25941
S34810%

 

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 :

Capture.PNG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
shirleyc40
Creator
Creator
Author

Seems like I typed the value wrong in the question, they match up in the actual data. Thank you!