Input collection: myTeams43
Team | Person1 | Person2 | Person3 |
Team A | Jen Phillips | Leonard Petersen | Murray Cole |
Team B | Percy Walters | Adam Davidson | Alice Lemon |
Team C | Sarah Davy | Melissa Stevens | Bernice Friesen |
Output collection: mySolution43a (remove Person3 column)
Team | Person1 | Person2 |
Team A | Jen Phillips | Leonard Petersen |
Team B | Percy Walters | Adam Davidson |
Team C | Sarah Davy | Melissa Stevens |
Solution code:
//Create a collection
ClearCollect(myTeams43,
{Team: "Team A", Person1: "Jen Phillips", Person2: "Leonard Petersen", Person3: "Murray Cole"},
{Team: "Team B", Person1: "Percy Walters", Person2: "Adam Davidson", Person3: "Alice Lemon"},
{Team: "Team C", Person1: "Sarah Davy", Person2: "Melissa Stevens", Person3: "Bernice Friesen"}
);
//Remove a column code
ClearCollect(mySolution43a, DropColumns(myTeams43,"Person3"));
Output collection: mySolution43b (show only ‘Team’ & ‘Person1’ column)
Team | Person1 |
Team A | Jen Phillips |
Team B | Percy Walters |
Team C | Sarah Davy |
Solution code:
//Create a collection
ClearCollect(myTeams43,
{Team: "Team A", Person1: "Jen Phillips", Person2: "Leonard Petersen", Person3: "Murray Cole"},
{Team: "Team B", Person1: "Percy Walters", Person2: "Adam Davidson", Person3: "Alice Lemon"},
{Team: "Team C", Person1: "Sarah Davy", Person2: "Melissa Stevens", Person3: "Bernice Friesen"}
);
//Remove multiple columns code
ClearCollect(mySolution43b, DropColumns(myTeams43,"Person2","Person3"));