JOIN One Columns From Another Collection

Input collection: mySales3

ProductIDQuantitySold
10014
10025
10017
10001
10008


Input collection: myProduct3

ProductIDProductName
1000Jacket
1001T-Shirt
1002Baseball Cap


Output collection: mySolution3

ProductIDProductNameQuantitySold
1001T-Shirt4
1002Baseball Cap5
1001T-Shirt7
1000Jacket1
1000Jacket8


Solution code:

//Create two collections
ClearCollect(myProduct3,
{ProductID: "1000", ProductName: "Jacket"},
{ProductID: "1001", ProductName: "T-Shirt"},
{ProductID: "1002", ProductName: "Baseball Cap"}
);

ClearCollect(mySales3,
{ProductID: "1001", QuantitySold: 4},
{ProductID: "1002", QuantitySold: 5},
{ProductID: "1001", QuantitySold: 7},
{ProductID: "1000", QuantitySold: 1},
{ProductID: "1000", QuantitySold: 8}
);

//Add a column from another table code
ClearCollect(mySolution3,
    AddColumns(mySales3,"ProductName",LookUp(myProduct3,ProductID=myProduct3[@ProductID],ProductName))
);