Working with Tables

Once a table has been created or opened in Deephaven, its content and layout can be further manipulated in the user interface. For example, users can choose to hide or show certain columns, change the column order, resize column widths, filter and/or sort the data in the columns, or add more columns to the table.

The following screenshot shows a table in the dashboard.  In this example, summaries is the table name, and the names of six columns are presented in the column header row including ImportDate, Ticker, Open, High, Low and Close. The vertical scrollbar on the right allows users to scroll through the rows in the table and the horizontal scrollbar at the bottom allows users to view additional columns that may exist in the table.

Adjusting Column Width

It is possible to adjust the width of individual columns within tables by hovering your cursor over the gap between columns. When you're at the correct location, the cursor will change to a horizontal double-ended arrow with a vertical crossbar. Simply click and hold the mouse to increase or decrease column width and release the mouse button. Columns will auto-size to fit their data, if not adjusted. Sizing a column down all the way will set the column to hidden.

Column Information

Basic information about the content of each column can be reviewed by hovering your cursor over the column name.  For example, the screenshot below demonstrates the information available when hovering the cursor over the Ticker column.

The tooltip shows the column name (Ticker), the data type (String) and the number of rows in the column (656,894).  Additional information about this column is available by selecting the Generate Stats option. Generated stats will be calculated automatically for tables with less than 100,000 rows.

Generate Stats

When Generate Stats is selected, the tooltip expands to show additional information about the column, as shown below.

Because this column's data has a data type of String, the generated information includes the Count, Min, and Max values for that column. However, columns containing other data types will present different statistical information.  See Appendix: Generated Stats by Column Data Type.

Renaming Tables

You can rename any open table by right-clicking its tab, as shown below:

Table Options Menu

The Table Options menu can be opened from any Deephaven table by clicking the icon at the right of the header row:

Chart Builder

The Chart Builder allows you to create applicable charts from the table data. This feature is covered in detail in the Working with Plots section.

Column Visibility & Ordering

The Column Visibility & Ordering feature allows you to quickly hide/show, rearrange, and sort columns in one place.

Open the Table Options menu at the right of the table you' d like to modify, and select Column Visibility & Ordering:

The dialog lists the columns in the table, and the eye icon next to each indicates which columns are visible. As shown below, clicking the icon will show/hide columns. The Sym column is being hidden, and the ExchangeId, and ExchangeTimestamp columns were hidden previously:

Columns can be reordered by dragging and dropping items in the list:

This can also be accomplished using the arrow buttons at the top of the dialog:

The toolbar includes additional buttons to sort the table in ascending or descending order, and a Reset button to restore the table to its default arrangement.

Manage Custom Columns

Manage Custom Columns is a feature that enables you to quickly add new columns to house custom calculations directly in the Deephaven interface, rather than updating a table's query. See also: Custom Columns.

Open the Table Options menu at the right of the table, and select Manage Custom Columns to build new columns:

In the Manage Custom Columns dialog, enter the name of the new column, then write the formula below. For example, you could add a new column called "Total" that multiplies the last price and size for each row in the StockTrades table:

Select Save Column to add the new column:

Reopen the dialog to edit your selections. Other columns and their respective formulas can be added by clicking the + Add Another Column button. It may be necessary to arrange the order of your custom columns for calculations to work correctly. To change the order of the new custom columns, click the drag icon () and drop the column information to the desired position. To remove a custom column, click the trash can button () to the left of the column name, and select Save Column.

Download CSV

You can download all or some of the rows in a Deephaven table into a CSV file to save on your local computer. Open the Table Options menu and select the Download CSV option:

Choose from the following options:

  • All Rows - This downloads the entire table. The number of rows appears in parentheses.
  • Only Selected Rows - This downloads only the rows you have highlighted in the table. When rows are selected, the number of rows appears in parentheses.
  • First/Last - This downloads rows from the start or end of the table. Select First or Last from the drop-down menu and specify an amount of rows.

A file name is automatically generated, but you can rename the file in the File Name field. After you click Download, the CSV file will save into the default location on your local computer.

Quick Filters

When the Quick Filters button is set to On, the Quick Filters bar will be added to that table:

You can also open or close the Quick Filters bar using the keyboard shortcut Ctrl + F or Cmd + F.

Search Bar

When the Search Bar button is set to On, the search bar will be added to that table:

By default, all columns will be searched for your term. You can configure cross-column search using the Settings dialog at the right of the search bar:

You can also open or close the search bar using the keyboard shortcut Ctrl + S or Cmd + S.

Table Context Menus

Dashboard tables contain several context menu shortcuts to help speed analysis. To access these menus, simply right-click on the applicable part of the interface, as described below.

Column Headings Context Menu

The screenshot below demonstrates the context menu revealed when a right-click is performed on a column heading.  In this case, the EODTimestamp column was selected for the right-click.

Hide Column/Show All Columns - Selecting the Hide Column option removes that column from the table display. The Show All Columns option is only available when a column has previously been hidden from view.  When selected, all hidden columns are returned to their original location in the table.

Advanced Filters - Selecting this option opens the Advanced Filters dialog window. See Filtering Table Values.

Quick Filters - Selecting this option opens a new toolbar on top of the table. See Filtering Table Values.

Remove All Filters - Selecting this option clears any filters applied to the table.

Remove Column Filter - Selecting this option clears a filter applied to that individual column.

Sort by - Selecting this option provides sorting methods for that column. See Sorting Menu.

Add Additional Sort - Selecting this option adds an additional sort to that column. See Sorting Menu.

Remove All Sorts - Selecting this option removes all sorts applied to that table.

Reverse Table - Selecting this option reverses the entire table's order. See Reversing Table Order.

Date/Time Format - Because the selected column contains a DateTime data type, an option to set the Date/Time Format is also available from this context menu.  When selected, the secondary context menu provides the following options:

If the right-click occurs on a column containing numerical data, the Number Format option becomes available from the context menu, as shown below:

Table Data Context Menu Options

The following context menu shortcuts are available when you right-click on table data:

Filter By Value - This context menu provides six options to filter the column based on the value of the table cell where the user right-clicked.

Copy Cell/Copy Cell Unformatted  - This option copies the cell's data with formatting to the clipboard.

Copy Cell Unformatted  - This option copies the cell's data without formatting to the clipboard. 

Sorting Table Values

Values in a table can be sorted in ascending or descending order by clicking on a column heading. 

Clicking once on a column heading sorts the table data in ascending order based on the content in the column selected.  When the table is sorted in ascending order, a blue "up" arrow will appear to the right of the column name.

Clicking again on the column heading changes the sort to descending order.  When the table is sorted in descending order, a blue "down" arrow will appear to the right of the column name. 

Note: A blue underline displays across the bottom of the column heading row anytime a table is sorted.

To clear the sorting order, click the column header one more time.

Unsorted

Sorted Ascending

Sorted Descending

There are also options for sorting a table in the Advanced Filters feature. See below.

Sorting Menu

Sorting options can be accessed through the right-click menu on column headings. The example below shows options for a column named "Ticker".

If another column has already been sorted, the Add Additional Sort option becomes available on the remaining columns in the table.

Selecting Remove All Sorts clears any sorts that have been applied to the table.

Reversing Table Order

Users can reverse the order of the rows in an entire table, where the last row becomes the first row and vice versa.

To reverse a table, right-click on any column header in the table and select Reverse Table from the sorting menu, as shown below:

The following three options are presented:

  • Reverse Before Sorting - Selecting this option reverses the table order immediately. This reversed table can then be manually sorted as many times as needed.
  • Reverse After Sorting - Selecting this option reverses the order of rows after manual sorting methods are applied. When more than one manual sorting operation is applied to the table, all sort operations are sequentially applied to the unaltered table before returning the rows in reverse order.
  • Remove Reversing - Selecting this option restores the order of the original table. If manual sorting has been applied to the table before this option is chosen, those sorting results remain visible in the table.

In the example below, the StockQuotes table has been reversed as indicated by the green bar:

The table is also sorted on the Exchange column; the green reverse table bar sits above the blue sort bar to indicate the table was reversed before sorting. If the Reverse After Sorting option is chosen, the green reverse table bar would move below the blue sort bar.

Filtering Table Values

Advanced Filters

As the name implies, the Advanced Filters feature provides advanced options to filter data in a table.  The Advanced Filters dialog can be accessed through the right-click menu on column headings. (Note: Advanced Filters can also be accessed by clicking on a column's funnel icon within the Quick Filters bar.  See Quick Filters below.

Selecting Advanced Filters from the right-click menu, generates the following dialog window:

The top of the Advanced Filters window provides two buttons that allow users to sort the entire underlying table based on the column selected.  You can sort the table in descending or ascending order by clicking the appropriate button.

 

Immediately below the name of the column being filtered is a selection menu that provides options for filtering the data in the selected column. The filtering options available in the Advanced Filters menu depend on the data type of the column selected. In this example, the Ticker column contains the String data type, as shown below:

Clicking in the menu reveals the filtering options available for this column type (String):

Note:  The filter options for other data types may differ from the choices shown above. 

Once the filter option has been selected, enter a value in the field to the right of the filter you just chose.  In the example below, AAPL is the filter value. 

After the value is entered, the underlying table is filtered accordingly.

You can filter the table by a secondary value by clicking on the AND or OR buttons just below the value field as shown below

Selecting either of them will add a new filter set to the dialog window.  In the example below, a second filter has been added for MSFT using the OR option. 

When this filter set is applied, the table will only present rows of data that include Ticker values equal to AAPL or MSFT.

Filters can be removed from the dialog by clicking the Trash Can icon to the right of the filter value, as shown below.

The lower portion of the Advanced Filters dialog enables users to filter the underlying table by selecting specific values.  Users can search for a value in the Find Ticker… field, or scroll through to select or deselect specific values found in the column. 

The upper and lower portions of the Advanced Filter work conjunctively - they both filter the same column.  However the upper portion of the Advanced Filter is processed first.  Therefore, if you filter a table using the upper filter criteria, the filtering specified in the lower section will be applied to the table after it has been filtered by the upper portion.

When you are finished selecting the respective criteria/criterium to filter the table, select Done to close the Advanced Filter dialog window.  If you want to clear all filters, selecting the Reset button will remove all filters.

Note:  You can also remove one or all filters by using the Column Header right-click menu.

Quick Filters

The Quick Filters option is available through the right-click menu on column headings, or by pressing Ctrl-F (⌘-F on macOS) on the keyboard.

The Quick Filter is intended to be an easy way to create a simple column filter.  It allows you to perform basic equal-to, less-than, greater-than, etc. types of filters in columns. (More advanced filtering can be accomplished using Advanced Filters, which is described above.)

The filter statement options available in Quick Filters are based on the data types in each column being filtered.  Please refer to the Quick Filter Statement Options in the Appendix for a complete list.

When the Quick Filters feature is selected, a new row is added to the top of all of the columns in a table. Each field in this row includes a text box and and a "funnel" icon.  To create a Quick Filter, enter any of the applicable filter statements into the text field at the top of the desired column. 

For example, typing MSFT into the text field at the top of the Ticker columns will filter that table to show only rows where the Ticker equals MSFT, as shown below.

Multiple Quick Filters can be applied to the table by typing additional values into the text field at the top of other columns.  For example, the image below shows the same table with a second filter statement in the Open column where the value is greater than 68.  Only those rows meeting both of those conditions are returned in the table.

For quick access to the Advanced Filters menu, select the funnel-shaped icon in the column header field as shown below. (See Advanced Filters).


Last Updated: 16 February 2021 18:07 -04:00 UTC    Deephaven v.1.20200928  (See other versions)

Deephaven Documentation     Copyright 2016-2020  Deephaven Data Labs, LLC     All Rights Reserved