Skip to main content
The Table option is good for looking at (surprise, surprise) tabular data, or for lists of things like user IDs or transactions. The options for Tables include:
  • Renaming the columns in your table.
  • Showing and hiding the columns in your table.
  • Showing and hiding the table name from the column labels.
  • Showing and hiding the totals for your columns.
  • Pivoting by a column.
  • Transposing your table (a.k.a. pivoting your metrics)
  • Locking a column from scrolling in your table.
  • Adding conditional formatting to your cells.
By default, we attach the table name to your field name (just in case you’ve got any duplicate fields from joined tables). But, you can easily turn this off in your table viz with a toggle.

Columns, rows, and metrics

Table visualizations have three components:
  • Rows: When a field is chosen for the row area, all of the unique values for that field are populated as values in the rows of your table.
  • Columns: When a field is chosen for the column area, all of the unique values for that field are populated as values in the columns of your table.
  • Metrics: If you have metrics in your table, then each metric cell shows the summarized information for a given row + column combination.

Adding tiny bars to table visualization

You can also enable tiny bars on each table cell, to improve visual feedback. To configure this, go to bar display on the sidebar, and select the numeric columns. We’ll calculate the min/max values , and we will display a tiny bar next to the value on the table Tinybars Config Pn This feature also works on pivot tables

Pivot tables

Pivot tables allow you to summarize larger sets of data in table visualizations by moving row values into columns. They’re also helpful to identify trends between two dimensions in your data using a table visualization. To add a pivot in your table, move a dimension to the column section of your table configuration. This will change the dimension from having its values populate the rows values of your table, to having it populate the column values of your table.
You can move up to 3 dimensions as columns and there is a limit of 60 column values in your table (e.g. pivoting by a dimension with 30 months, and another with 4 statuses won’t work because that will generate 4 x 30 = 120 column values).

Transposing your table

You can transpose your table so that your metrics become rows in your table instead of columns. This can be helpful if you want to compare a lot of metrics to each other (e.g. how my metrics are changing over time). To move your metrics to rows in your table, you need to have at least 1 dimension as a column (i.e. at least one pivot) then, you can click on show metrics as rows in the table configuration.

Totals

You can add column totals or row totals (in pivot tables) to your tables by selecting Show column totals or Show row totals in the chart configuration panel. The column totals in your results and table visualizations are calculated using the underlying data from your table, not only the values that are visible in the table.
Totals are not calculated for table calculations. Also, in pivot tables, totals are only shown for count and sum metric types.

Incorrect totals

Why are my totals lower? When using the count_distinct metric type, you can sometimes get totals that are smaller than if you sum up the values seen in the table. For example, if you count the distinct number of devices that viewed pages on our website each month, it would look something like this:
If you manually add each row in the Anonymous device count column, the value you get is much higher than the total shown in the table. This is because the same device can view pages on our website across many months. So, when you add up the values in the table, you’ll be counting some devices more than once. Lightdash uses a SQL query to calculate the distinct number of devices across all of the months so we avoid double-counting devices. Why are my totals higher? There are two reasons why this could be happening:
  1. You’ve set a row limit in your query that’s truncating the results. If the number of possible results from your query is larger than the row limit you’ve set, Lightdash will calculate the totals using all of the results (including the rows that have been removed from your table because of the limit).
  2. You’re using metric or table calculation filters. When you use metric or table calculation filters, the totals are calculated before the filters are applied.
How do I calculate totals based on what’s shown in my table? If you want to calculate totals based on just the values shown in your table, you can create a new column using a table calculation to do this. Here’s the table calculation you’ll need to use to do this:
SUM(${my_table_name.my_metric_name}) OVER()
This calculation isn’t a “true” total when you’re using metrics types that are count_distinct!

Subtotals

You can add subtotals to your tables by selecting Show subtotals in the chart configuration panel.
To use subtotals, you need to have at least 2 or more dimensions in your table visualization.

Freeze columns

If you have a wide table, you may want some columns to be locked to the left while you’re scrolling. Click on the lock icon beside the column(s) you want to keep pinned to the left of your table visualization to lock them in place.

Conditional formatting

Sometimes it’s helpful to highlight certain values in your tables when they meet a specific condition. You can set up conditional formatting rules by going to the Configure tab, then Conditional Formatting.

Highlighting cells

When you add a new rule, you’ll first need to pick which column should be highlighted and the type of rule you’d like to apply (Single or Range). There are three ways to compare data for each role:
  1. Values compares the chosen field to manual input values.
  • For example, color the Profit column red when a row is less than $10,000
  1. Field compares the chosen field to another field in your results.
  • For example, color the Revenue column green when it is greater than the Target revenue column.
  1. Field values compares another field in your results to manual input values, then formats your chosen field.
  • For example, color the Partner name column orange when the Total orders column is greater than 1,000.
You can set as many rules on a table as you want. If two or more rules disagree with each other, the rule that’s on the bottom of your list of rules will win.

Color ranges

To use color ranges for your rules, select Range under Conditional Formatting. You can choose specific minimum and maximum values, or you can automatically set them based on the values in your results. The color range will use a set of 5 colors mapped across the min and max colors selected in your rule.