Working with table layouts

If a table layout automatically generated by Analytics provides everything you need, you can use it without modification. There may be occasions, however, when you need to edit the table layout.

You may also want to perform other operations involving table layouts, such as renaming, copying, importing, and exporting.

Edit a table layout

In some cases, you may need to edit the automatically created table layout, or create the table layout manually. You can add, remove, or modify fields or records in a table layout as necessary.

Why would I edit a table layout?

You may want to edit a table layout for any of the following reasons:

  • Add or delete fields You want to add or delete data fields, computed fields, or data filters.
  • Modify default field definitions You want to modify the Analytics-created field definitions to change the data type, the format of numeric or datetime fields, or other properties of individual fields.
  • Define overlapping fields You want to define overlapping fields.

    Overlapping fields share one or more byte positions in a record. For example, if the first six positions in a record are defined as a full date field, you could define the first two positions as a month field. The two fields are overlapping.

  • Correct errors You want to correct errors identified after you defined the table using the Data Definition Wizard.

    For example, data may be incorrectly displayed, and you may need to modify the record length or the skip length.

  • Create a table layout manually You selected the Define Flat Files Manually option in the Options dialog box.

    This option changes the default behavior of Analytics. After you select a flat file as a data source, and provide other basic information in the Data Definition Wizard, the Table Layout dialog box is displayed and you must define the record(s) and fields for the Analytics table manually.

Rename a table layout

You can rename a table layout. Renaming a table layout does not rename the associated data file. You cannot rename a table layout if the table is currently open.

Note

If you rename a table layout that is referenced in an Analytics script you must also update all references to the table in the script or the script will fail when it is run.

Copy a table layout

You can copy a table layout to associate an identical table layout with the same Analytics data file or data source, and then subsequently modify the copied table layout. Copying and modifying a table layout may be easier than creating a new table layout from scratch.

Having more than one table layout associated with the same data file or data source allows you to define fields differently for the same data, create different subsets of fields, create different computed fields, and so on, which can be useful when working with large tables that would be unwieldy if all field definitions were included in a single table layout.

Caution

Be careful when you have more than one table layout associated with the same Analytics data file. If you have Delete Data File with Table selected in the Options dialog box, deleting any of the table layouts also deletes the data file, which means the data is no longer available for the remaining table layouts.

Data files are deleted outright. They are not sent to the Windows Recycle Bin.

Share a table layout

You can share a table layout to associate the same table layout with two or more Analytics data files. Generally, you should maintain a separate table layout for each data file. However, sharing a single table layout can save labor by allowing you to centrally manage a table layout for multiple data files.

For more information, see Don’t Share Table Layouts inTable options.

Note

Sharing a table layout is not the same as copying a table layout and sharing a data file.

  • When you share a table layout, a single table layout is associated with two or more data files.
  • When you share a data file, two or more table layouts are associated with a single data file.

Copy a table layout from another Analytics project

You can copy a table layout from one Analytics project to another, which allows you to reuse the table layout, and the field definitions it contains, rather than creating them from scratch. In addition to saving labor, reusing table layouts, or sharing them with other Analytics users, ensures consistency. You can copy a single table layout, or multiple table layouts simultaneously.

If a table layout specifies an association with a particular Analytics data file (.fil), and a data file of the same name exists in the folder containing the destination Analytics project, the copied table layout is automatically associated with the data file in the destination folder. If there is no data file with the same name in the destination folder, you need to link the copied table layout to a new data source.

Note

The copied table layout and the data file it is associated with must match – that is, the structure of the data in the data file must match the field definitions specified by the table layout.

Data structure refers to the data elements (fields) contained in a data file, the number and order of the fields, and the data type and length of the fields. If the table layout and the data file do not match, jumbled or missing data results.

Import a table layout

You can import a table layout that exists as a separate .layout file outside an Analytics project, which allows you to reuse the table layout, and the field definitions it contains, rather than creating them from scratch. In addition to saving labor, reusing table layouts, or sharing them with other Analytics users, ensures consistency. You can import only one table layout at a time.

If a table layout specifies an association with a particular Analytics data file (.fil), and a data file of the same name exists in the folder containing the project, the imported table layout is automatically associated with the data file in the folder. If there is no data file with the same name in the project folder, you need to link the imported table layout to a new data source.

Note

The imported table layout and the data file it is associated with must match – that is, the structure of the data in the data file must match the field definitions specified by the table layout.

Data structure refers to the data elements (fields) contained in a data file, the number and order of the fields, and the data type and length of the fields. If the table layout and the data file do not match, jumbled or missing data results.

Export a table layout

You can export a table layout as a separate .layout file saved outside the Analytics project. A table layout exported as a separate file can later be imported into any Analytics project, which allows you to reuse the table layout, and the field definitions it contains, rather than creating them from scratch. You can export only one table layout at a time.

Delete a table layout

You can delete a table layout associated with an Analytics data file or a data source whenever necessary. Deleting a table layout also deletes the associated views, and any associated indexes or table relations.

Caution

Be careful when deleting table layouts. If you have Delete Data File with Table selected in the Options dialog box, deleting a table layout also deletes the data file, which means the data is no longer available.

The Delete confirmation dialog box warns you if the associated data file will be deleted along with the table layout.

Data files are deleted outright. They are not sent to the Windows Recycle Bin.