Remove From Grid
Remove From Grid
This component will take in grid data and remove data from it. This can be used to remove rows from grid columns but not the columns themselves.
|Name||Text||The descriptive name for the component.|
|Main Grid||Select||The grid variable to remove data from.|
|Fixed/Grid||Select||The name of the table from which metadata will be taken|
|Operation||Select||In: Remove only the data specified from the Main Grid.
Not In: Remove all data except the data specified from the Main Grid.
|Key Columns||Multiple Select||Select all columns that data is to be specified for, marking data to be removed.|
|Values Grid||Multiple Text||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||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||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.