Remove From Grid
Remove From Grid
This component will take in Grid Variable data and remove data from it. This can be used to remove rows from grid columns but not the columns themselves.
To determine which data is to be removed, the Main Grid elements are matched to those in a fixed list or another Grid Variable and either kept or discarded accordingly.
For more information on Grid Variables, see the full documentation.
|Name||Text||The descriptive name for the component.|
|Main Grid||Select||The ('Main') Grid Variable to remove data from.|
|Fixed/Grid||Select||Select whether to match elements of the Main Grid Variable to those in a fixed list or a Grid Variable (that must be created in advance).|
|Operation||Select||In: Remove all data except the data specified from the Main Grid.
Not In: Remove only the data specified from the Main Grid.
|Key Columns||Multiple Select||Select all columns in the Main Grid that will be used to match, marking data to be removed.|
|Values Grid||Multiple Text||(When 'Fixed') Enter data into each Key Column that will match to data in the Main Grid. Depending on the 'Operation' chosen, matching rows will either be removed or kept.|
|Source Grid Variable||Select||(When 'Grid') The grid that contains data that will match data in the Main Grid. These matches will define which rows in the Main Grid are removed or kept, depending on the 'Operation'.|
|Key Column Mapping||Multiple Select||(When 'Grid') Map columns in the Other Grid to those in the Main Grid. Matching data between mapped columns will define which rows in the Main Grid are removed or kept, depending on the 'Operation'.|
In this example we have a table of flight data and we want to make a new table with the same metadata but with a single column removed; 'dayofweek' is to be removed since has been deemed unnecessary so long as 'dayofmonth' is included. The Get Metadata component is used to take the flight table metadata into a grid variable. We then use the Remove From Grid component to remove the 'dayofweek' row from the grid variable before using it to define metadata in the new table. The job is shown below.
The Remove From Grid component is set up as below. Our Metadata grid is taken as the Main Grid and we choose the 'Fixed' option so that we can manually enter the data that is to match removed data. In this case, we only want to remove 'dayofweek' from the 'name' Key Column.
Finally, this grid variable is used to define the metadata on the new flights table 'flights_newyear' in the Create/Replace Table component. When this job is run, columns in the new table are defined using the metadata in our grid variable, as mapped in the 'Table Metadata' property.
When run, this job will create the new table with the same metadata as the original flights data but without the 'dayofweek' column. This can be confirmed by comparing the metadata when loading this table in a Table Input component.