# Table Chart

## Render Types

Table charts support the following render types. In the raw table, you can select fields and filter rows. In the aggregated table, you can also aggregate values.

| Raw Table <picture><source srcset="/files/ke7u3aMEEVRUn9D8goGi" media="(prefers-color-scheme: dark)"><img src="/files/uRPYM14cYhlmvgRNQye0" alt="Table Raw"></picture> | Aggregated Table <picture><source srcset="/files/QDd6vZwdEIl3LQ3gy3xc" media="(prefers-color-scheme: dark)"><img src="/files/39X1e22P0rW887ac45W2" alt="Table Aggregated"></picture> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

## Specifications

### Source Types

Table charts have two source types. Depending on the selected source type, the aggregation and display behavior differs.

| Source Type                        | Description                  | Column Roles                                                                                       |
| ---------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
| Raw data (raw table)               | Display retrieved rows as-is | Select columns to display                                                                          |
| Aggregated data (aggregated table) | Group and aggregate          | [Group (dimension) and values (metrics)](/data-exploration/chart/chart-common.md#dimension-metric) |

## Tips

### Image Display

By specifying an image URL in a column and turning on "Enable" in "Advanced" > "Column Settings" > "Image URL Preview", the image at the specified URL will be displayed in the table chart.

| <picture><source srcset="/files/WUbpTkkCwTE64u4UvnCC" media="(prefers-color-scheme: dark)"><img src="/files/Sn46dhAq0DelnGvb8UAx" alt="Table Image Preview"></picture> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### Link Display

By specifying a URL in a column and enabling "Enable link URL" under "Advanced" > "Column Settings", the table chart will display the URL as a link that opens in a new tab.

| <picture><source srcset="/files/p68wcoXkvJG2FLUrlib7" media="(prefers-color-scheme: dark)"><img src="/files/JSHJz43ajDLzcU6XN7BO" alt="Table Link URL"></picture> |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |

#### Creating Parameterized Links from Table Charts to Reports

By dynamically generating URLs in SQL queries, you can pass data from each row of the table as parameters to another report page.

1. Creating a report and obtaining the URL
   * Set parameters in the destination report and obtain the URL from the browser's address bar.
     * `Example URL: https://app.codatum.com/workspace/{workspace_id}/report/{report_id}/{page_id}`
   * How to check parameter ID: Note the ID of the parameter widget in the report (e.g., `68f369edf5e6f69036b8872d`)
2. Creating a URL column in SQL
   * Use the CONCAT function to generate a URL containing parameters from each row's data and insert it into the chart.
   * Example with a single parameter (country name):

     ```sql
     CONCAT(
       'https://app.codatum.com/workspace/{workspace_id}/report/{report_id}/{page_id}?cdm.params.{parameter_id}=',
       country  --- Column name to pass as parameter
     ) AS link
     ```
3. Enabling links in table chart
   * Table chart settings → Column settings → Target column → Turn on "Enable link URL".

Notes

* Replace the `country` part with the database column name you want to pass as a parameter
* You cannot reference the current value of parameter widgets in SQL (only fixed values or column values)
* When a user clicks a cell, the report opens in a new tab
* For detailed information on parameter settings, see [here](/data-exploration/parameter-overview/set-parameters-via-url.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.com/data-exploration/chart/table-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
