Input collection: myTrucks50
Serial | Year | Make | Model |
8943 | 2020 | Ford | F150 |
4623 | 2018 | Chevy | Silverado |
2315 | 2019 | Ford | F150 |
5466 | 2020 | Chevy | Avalanche |
Output collection: mySolution50a (remove truck with Serial ‘4623’)
Serial | Year | Make | Model |
8943 | 2020 | Ford | F150 |
2315 | 2019 | Ford | F150 |
5466 | 2020 | Chevy | Avalanche |
Solution code:
//Create a collection
ClearCollect(myTrucks50,
{Serial: 8943, Year: 2020, Make: "Ford", Model: "F150"},
{Serial: 4623, Year: 2018, Make: "Chevy", Model: "Silverado" },
{Serial: 2315, Year: 2019, Make: "Ford", Model: "F150" },
{Serial: 5466, Year: 2020, Make: "Chevy",Model: "Avalanche"}
);
//Remove truck with serial 4623 code
ClearCollect(mySolution50a, myTrucks50);
Remove(mySolution50a,LookUp(mySolution50a,Serial=4623));
Output collection: mySolution50b (remove trucks with ‘Ford’ make)
Serial | Year | Make | Model |
4623 | 2018 | Chevy | Silverado |
5466 | 2020 | Chevy | Avalanche |
Solution code:
//Create a collection
ClearCollect(myTrucks50,
{Serial: 8943, Year: 2020, Make: "Ford", Model: "F150"},
{Serial: 4623, Year: 2018, Make: "Chevy", Model: "Silverado" },
{Serial: 2315, Year: 2019, Make: "Ford", Model: "F150" },
{Serial: 5466, Year: 2020, Make: "Chevy",Model: "Avalanche"}
);
//Remove all trucks with Ford make code
ClearCollect(mySolution50b, myTrucks50);
RemoveIf(mySolution50b,Make="Ford");