Generator: Table Row/Column Filter

This generator looks at all of the input Table Items and for each one, removes selected rows or columns from the table item creating a new table item. There will be one output table item for every input table item. There are separate filters for the rows and columns. The generator may either select the rows/columns to keep in the output thable or select what rows/columns to remove from the output table. Finally, it includes an option to output the transpose of the input table.  The default configuration is to essentially clone the input table, that is select all rows and columns to be placed into the output table and not to transpose the table.

Configuration options

There are a few configuration options for this generator.  The first is the ability to set the name for the generated table(s). The table name can include macro expansions and will use the current data item to access additional macro sources (e.g. tag values).



The 'Rows...' and 'Columns...' buttons will bring up dialogs that allow one to select a collection of rows and columns.  By default, the selected rows/columns will be included in the output and other rows/columns will be removed.  If the 'Select the rows/columns to remove' checkbox is checked, the collection of rows and columns will be removed instead of retained.  

By default, the output rows and columns will retain relative positions they occupied in the original table. If the generation has been configured to preserve rows/columns (instead of removing them), the 'Sort rows/columns by selection order' checkbox may be used to change their positions. The order of the row/column specification is used to select the new order. The sorting is performed both on the rows and columns, independently. For example, if the 'Rows...' dialog is configured like this:

Then the row with the name "Time" will be the first row in the output table.  The rows selected by "Pressure*" will follow in the same relative order that those rows had in the original table. Thus, the selection "*" will copy all rows in their original order, even if the sorting checkbox is checked.

Finally, there is a checkbox that specifies that the new, filtered table should be transposed (rows and columns swapped) before being output.

Example

In the example we will focus on a single input table of element counts by the names of parts. The report template layout looks like this:



The top level layout selects the specific table we want to process. 'Filter' is a table Row/Column generator template instance. The configuration of this generator looks like this:



Of note here is that the "Generated items" option is set to 'Append', so that after the generate is run, both the input table and the generated table will both be passed to the 'Tab layout' layout. The generated table will have the name 'RC_Filtered_Table' (as per the configuration). The 'Filtered Table' layout selects only input tables with that name while the 'Raw Table' layout selects only tables with names that do not have that name.  This is a common theme with generators. They can augment the data item lists with new items with specially constructed names or tags that child layouts may filter down to.

The row and column filter dialogs in this example look like this:



Three rows and three column names are selected for inclusion in the output. The dialogs illustrate the various methods for selecting rows/columns.  First, one can use the row or column number. In the example row 0 and column 1 will be preserved. This can be useful if there are no row/columns labels on a table item.  The second case involves the use of a specific row/column name. The row labeled 'fuselage' and the column labeled 'Tria3' will be preserved in the output.  Finally, it is legal to use 'glob' style wildcards together with the label filters.  So, any row with 'wing' in its label will be kept and any column whose label starts with 'Tetra' will be kept.

The output of this report looks like this:





Notice that the selected rows and columns were extracted from the original table and used to make a new table with a different name.

A Second Example


Filtering rows