Input collection: myTeams44
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: mySolution44a (show only ‘Team’ column)
Team |
Team A |
Team B |
Team C |
Solution code:
//Create a collection
ClearCollect(myTeams44,
{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 all columns except a single column code
ClearCollect(mySolution44a, ShowColumns(myTeams44,"Team"));
Output collection: mySolution44b (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(myTeams44,
{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 all columns except multiple columns code
ClearCollect(mySolution44b, ShowColumns(myTeams44,"Team","Person1"));