The Data Table Tab

The Data Table tab displays a dataset as a table of rows and columns. In this tab you can filter and sort rows, select rows and columns, configure columns, exclude rows, edit values, and export and reload the dataset.

You can open a Data Table tab from the dataset list in Project Overview, from View > Dataset in the menu bar, or from the + button in a pane.

You can open several Data Table tabs for the same dataset. The filter expression, sort conditions, and column widths are settings of each tab and do not affect other tabs of the same dataset. When you save the project and open it again, each tab opens with the settings it had when you saved.

The screenshots on this page use the columns of the Auto MPG dataset. See Sample Datasets for the meaning of the columns.

Screen Layout

The Data Table tab consists of the parts numbered 1 to 6 in the following figure.

Data Table tab with a number on each part of the screen

  1. Info button that opens the Dataset Metadata dialog
  2. Filter input
  3. Button that opens the table menu
  4. Row number column
  5. Column header
  6. Sort button

The Dataset Metadata Dialog

The Dataset Metadata dialog shows basic information about the displayed dataset, together with its source or the operation that created it. Open it with the info button at the right end of the dataset name.

Dataset Metadata dialog of a Primary Dataset

You can edit Description in this dialog.

Reading the Table

Column Header

A column header shows the column name, the data type, and the measurement scale. When you hover over the measurement scale, the tooltip shows "(inferred)" for a scale that MIDAS inferred automatically and "(user-defined)" for a scale you set manually.

Use the column header for operations on a column. Click a column header to select the column, and right-click it to open the column settings menu. Use the button at the right end to sort. Drag the right border of a column header to change the column width.

Row Number

A row number identifies a row. The row numbers of the rows that remain in the table do not change when you filter, sort, or exclude rows. For the context menu of a row number cell, see Row Operations.

Cells

MIDAS shows a cell with a missing value as blank with a different background color.

Filter

When you enter an expression in the filter input, only the rows that match the condition remain in the table.

While the expression in the input is invalid, MIDAS does not filter by that expression and keeps the table filtered by the last valid expression. Hover over the input to see why the expression is invalid.

Data Table tab with an expression whose value does not match the column type

Data Table tab with a filter applied

The filter also narrows the rows that the Statistics tab and the Selected Columns tab use. Both tabs use only the rows that match the filter of the Data Table tab they target. When the same dataset is open in several Data Table tabs, they do not use the filters of the tabs they do not target.

While a filter is active, the Save Filtered Data button appears to the right of the input. This button saves the filtered rows as a derived dataset and opens a Data Table tab for that dataset. When the source dataset is updated, MIDAS filters the rows of the saved derived dataset again with the updated values. For details, see Recomputation When a Dataset Changes.

A filter expression combines conditions such as model_year >= 80 with AND, OR, NOT, and parentheses. See Filter Expressions for how to write column names and values, the available conditions, the rules for comparison and missing values, and stat functions.

When the data type or the measurement scale of a column of the displayed dataset, or the values of the enum definition that a column uses, change later, or a column disappears, MIDAS continues to evaluate the filter expression applied to the tab against the changed dataset. Unlike an invalid expression being entered, MIDAS does not clear the applied expression even when the change makes the expression invalid. In this case the input shows an error, and MIDAS evaluates the condition that became invalid as a condition that matches no row. The rule for negated conditions still applies, so the negation of a condition that became invalid matches every row.

Sort

Click the button at the right end of a column header to sort the rows in ascending order of that column. Click it again to sort in descending order, and click it a third time to return to the original order.

When you click while holding Ctrl/Cmd, MIDAS adds the column to the sort conditions and shows a priority number on the button.

Data Table tab sorted by two columns

An enum column is ordered by the order of the enum definition, regardless of its measurement scale. Missing values are placed last in both ascending and descending order.

Sorting changes only the display order. The row numbers and the row selection do not change.

Selecting Rows and Columns

Clicking a row clears the previous selection and selects only that row. Clicking while holding Ctrl/Cmd keeps the previous selection and adds the row to it. Clicking a selected row while holding Ctrl/Cmd deselects only that row. Clicking while holding Shift adds to the selection the range from the row you last clicked without Shift to the clicked row. When exactly one row is selected, clicking that row clears the selection. The row selection is linked with the Statistics tab and Graph Builder. For how the linking works, see Row Selection and the Filtered Data Tab.

Clicking a column header clears the previous column selection and selects only that column. Clicking while holding Ctrl/Cmd keeps the previous selection and adds the column to it. When exactly one column is selected, clicking its column header clears the selection. The Selected Columns tab shows the selected columns.

Data Table tab with rows and a column selected

Column Settings

Right-clicking a column header opens a menu of operations on that column.

Context menu of a column header

Edit Column Name makes the column name editable. Double-clicking a column name does the same. The column names of a derived dataset cannot be changed, because they are determined by the SQL or the conversion settings that created the dataset. In a derived dataset, Edit Column Name is disabled.

Edit Scale of Measurement opens a dialog for choosing the measurement scale of the column. For the meaning of each scale, see Data Types and Measurement Scales.

When you change the measurement scale, MIDAS recomputes the derived datasets and models that depend on the dataset. For the scope of the recomputation, see Recomputation When a Dataset Changes. Convert Column Types... opens the Convert Column Types tab, which converts the data types of columns.

Normalize Variants... opens the Normalize Variants tab. In that tab, you unify values written in varying ways into a single form. This item appears only in the menu of string and enum columns.

The number format set with Number Format... and the link display set with Display as Link... can each be set on the dataset or on a Data Table tab. These two settings are together called the display format. A display format set on the dataset takes effect in every table that shows the rows of the dataset. A display format set on a Data Table tab takes effect only in that tab. For each of the number format and the link display, when a column has the setting both on the dataset and on a tab, MIDAS displays the column in that tab with the setting on the tab.

Number Format... opens a submenu that lists number format presets. This item appears only in the menu of int64 and float64 columns.

Choosing Default removes the number format and leaves the link display as it is. MIDAS displays a column with a number format neither on the dataset nor on the tab in the column's default format. For a column that a Derived Dataset includes from its input dataset, the default format is the number format of that column in the input dataset. For a column without a default format chosen by MIDAS, the default format is the one set in Number Format in Settings.

When you turn on This view only in the submenu and then choose a preset, MIDAS sets the format on the Data Table tab where you opened the menu, not on the dataset. In that case, Default removes the number format on the tab, and the number format on the dataset remains.

Display as Link... opens a dialog for the setting that displays cell values as links. Write the URL of the link destination in URL template. A {column name} written in the URL is replaced, for each row, with the value of that column in the same row. In Apply to, choose whether to set the link display on the dataset or on the Data Table tab. You can remove the link display with Remove in the dialog. Remove does not remove the number format. A link display taken from a column of the input dataset is removed on that column of the input dataset.

When the provenance of the project includes a signer that is not trusted, MIDAS does not display cell values as links. In this case, a Data Table tab that has a column with a link display shows a warning above the table that explains why links are disabled. For how to register a signer as trusted, see Managing Signing Keys.

Row Operations

Row number cells and data cells each have their own context menu. The menu of a row number cell applies to the row you right-clicked. However, when the row you right-clicked is selected, the menu applies to all selected rows.

Context menu of a row number

Exclude this row excludes rows of a Primary Dataset. For how excluded rows are handled and how to restore them, see Excluding and Restoring Rows.

Add comment adds a comment to rows of a Primary Dataset. A row with a comment has a mark next to its row number. You can rewrite the comment with Edit comment.

Contributing rows opens, in a Contributing rows tab, the rows of the source dataset that were used to create the target rows. When the source dataset was itself created from another dataset, you can choose in the submenu which dataset to trace back to. This item is disabled for a Primary Dataset and for a derived dataset created by an operation whose original rows cannot be traced.

The menu of a data cell has Copy Cell Value and Contributing rows. Copy Cell Value copies the text displayed in the cell to the clipboard. Contributing rows behaves the same as the item with the same name in the menu of a row number cell.

Excluding and Restoring Rows

Excluding rows removes rows from a Primary Dataset and keeps them so that you can restore them later. Excluded rows are also absent from the derived datasets created from that dataset. The row numbers of the remaining rows do not change.

The Data Table tab of a Primary Dataset that has excluded rows shows the number of excluded rows above the table, as in "3 rows are excluded from this dataset." The View excluded rows button next to it opens the Excluded Rows dialog.

Data Table tab with the list of excluded rows open

Restore excluded rows in the Excluded Rows dialog. A restored row keeps the row number it had before the exclusion and returns to its position in row number order. MIDAS removes from a restored row the reason written at the exclusion and the date and time of the exclusion.

Editing Data (Edit Mode)

Edit Mode is a mode for rewriting the cells of a Primary Dataset directly. Choose Edit Data in the table menu to enter Edit Mode. A Primary Dataset that keeps its original file cannot be rewritten in Edit Mode. For how to correct the values of such a dataset, see Creating a Dataset. During Edit Mode, you cannot exclude or restore rows, or add or edit comments.

Data Table tab in Edit Mode

In Edit Mode, MIDAS saves an empty input, null, and (null) as a missing value.

When you enter in a cell a value that cannot be converted to the data type of the column and move to another cell, MIDAS draws a red border around that cell. The Edit Mode toolbar shows on a button the number of cells that hold such a value, as in "3 cells cannot be interpreted". Clicking the button moves to the first of those cells. You cannot click Done while any such cell remains.

Add a row with + Add Row at the end of the table. To delete a row, right-click its row number and choose Delete Row. An added row gets the next row number after every row number the dataset has used so far.

The dataset does not change until you click Done. When you click Done, MIDAS saves the edits and recomputes the derived datasets and models created from that dataset. For how the recomputation works, see Datasets.

Table Menu

The ⋮ button to the right of the filter input opens a menu of operations on the whole dataset. The items depend on the kind of dataset.

ItemShown for
Edit DataPrimary Dataset; disabled for a dataset that keeps its original file
Rename...All datasets
Add to ReportAll datasets
ExportAll datasets
View SQL QueryDerived dataset created with SQL
Save data with projectDerived dataset
Prevent ReloadPrimary Dataset
Reload Dataset...Primary Dataset; disabled while Prevent Reload is enabled
Reload Source Dataset...Derived dataset created from a Primary Dataset; disabled while Prevent Reload is enabled for all of its sources

Data Table tab with the table menu open

Rename... changes the name of the dataset. The name in the saved queries that refer to this dataset is also rewritten to the new name. For which names are rewritten, see Table and Column Names.

View SQL Query shows, in a separate tab, the SQL query that created the derived dataset. For how to edit this query, see Editing Derived Datasets.

Save data with project includes the computed result of the derived dataset in the project file. For its effect and its impact on file size, see Datasets.

Adding to a Report

Add to Report adds the table of the displayed dataset as an element of a report. In the dialog, choose an existing report or create a new one, and specify the columns to display and the maximum number of rows. The row number column is added at the front automatically.

The element inherits the filter of the Data Table tab it was added from and the display formats set on that tab. When a filter is active, its expression is saved in the element. The element in the report also displays only the rows filtered by that expression. For changing the columns and the number of rows after adding, see Reports.

Exporting Data

Export writes the rows of the dataset to a CSV, TSV, or JSON file.

MIDAS writes only the rows that match the filter, in the order after sorting. When rows are selected, you can write only the selected rows by turning on Export selected rows only in the dialog. In this case, MIDAS does not apply the filter and the sort, and writes the rows in the order of the rows in the dataset.

You can also write a dataset to CSV without opening a Data Table tab, with File > Export Data as CSV... in the menu bar. When you choose one dataset in the dialog, MIDAS writes all rows of that dataset in the order of the rows in the dataset.

Reloading a Dataset

Reload Dataset... replaces the rows of a Primary Dataset with the rows of a new file. For the files you can reload from and what reloading keeps and removes, see Reloading a Dataset.

See also