Table Method Overview
addTable
Section titled “addTable”The addTable method is mandatory for creating a new table, as it initializes the widget in the associated report.
Syntax:
$olap.addTable( "table_id", "title_label", "icon", "data_filter", "row_limit")Example:
$olap.addTable( "top_5_product_groups", "Top 5 Sales by Product Groups (YTD)", "pencil", "", "5")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | A user-defined unique identifier for this table. The table_id specified here must be passed as an argument to subsequent methods |
title_label | Yes | The text label displayed as the title of this table |
icon | Yes | A FontAwesome icon for the table. Available icons: FontAwesome |
data_filter | Yes | General filter expression to limit which data is included for the table. Set to NULL if not required |
row_limit | Yes | The limit number of rows (records) to display in the table. Set to NULL if not required |
setTableSource
Section titled “setTableSource”Overrides the default data source for a table, allowing it to retrieve data from an alternative table or view. This is useful when table data is stored in a different dataset than the report’s main data source. Using filter and drill functionality works if the dimensions are equally named (same column names).
Syntax:
$olap.setTableSource( "table_id", "alias_key", "matrix_name")Example:
$olap.setTableSource( "top_5_product_groups", "mssql", "fact_sales_statistics")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
matrix_name | Yes | The name of the alternative data source table or view |
alias_key | No | The connection key for an external database if the data source is in a different database |
addTableColumn
Section titled “addTableColumn”Adds a new column to an existing table.
Syntax:
$olap.addTableColumn( "table_id", "column_id", "header_label", "value", 'value_format', 'prefix', 'suffix')Example:
$olap.addTableColumn( "top_5_product_groups", "sales_ytd", "Sales YTD", "SUM(CASE WHEN [invoice_month] IN ?period.getCP_YTD() THEN [invoiced_amount_dcur] ELSE 0 END)", '###,###')Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id | Yes | A user-defined unique identifier for this column. The column_id specified here must be passed as an argument to subsequent methods |
header_label | Yes | The text label displayed as the header of this column |
value | Yes | Defines the column value. Typically contains an expression for the current metric |
value_format | Yes | The display format for the column value, using standard formatting syntax (e.g., number of decimals, thousand separators, percentage signs). Set to NULL if not required |
prefix | No | Text or symbol displayed before the column value (e.g., USD) |
suffix | No | Text or symbol displayed after the column value (e.g., ex. tax) |
setTableGroupBy
Section titled “setTableGroupBy”Groups rows in a table based on the values of a specified column. This is useful for summarizing data at a higher level by aggregating rows that share the same value in the selected column.
Syntax:
$olap.setTableGroupBy( "table_id", "column_id")Example:
$olap.setTableGroupBy( "top_5_product_groups", "sales_ytd")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id | Yes | The unique identifier of the column to update |
setTableOrderBy
Section titled “setTableOrderBy”Defines the sort order for rows in a table. You can specify which column to sort by and whether the sort should be ascending or descending.
Syntax:
$olap.setTableOrderBy( "table_id", "column_id sort_direction")Example:
$olap.setTableOrderBy( "top_5_product_groups", "sales_ytd desc")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id sort_direction | Yes | The unique identifier of the column to update and sort direction combined as a string. Valid arguments: asc = Ascending, desc = Descending |
setTableColumnImages
Section titled “setTableColumnImages”Adds visual indicators to a table column based on threshold values using FontAwesome icons. It dynamically displays different icons for values below, between, or above defined thresholds, allowing users to quickly interpret data performance.
Syntax:
$olap.setTableColumnImages( "table_id", "column_id", "red_icon", "yellow_icon", "green_icon", "yellow_limit", "green_limit")Example:
$olap.setTableColumnImages( "top_5_product_groups", "sales_ytd", "caret_down", "caret_right", "caret_up", "10000000", "5000000")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id | Yes | The unique identifier of the column to update |
red_icon | Yes | Icon displayed when the column value is below the yellow limit |
yellow_icon | Yes | Icon displayed when the column value is between the yellow and green limits |
green_icon | Yes | Icon displayed when the column value exceeds the green limit |
yellow_limit | Yes | Threshold value defining the boundary between red and yellow status |
green_limit | Yes | Threshold value defining the boundary between yellow and green status |
setTableColumnTrendImage
Section titled “setTableColumnTrendImage”Adds dynamic icons to a table column to visually represent trends between two values (previous vs. actual). It allows you to show different icons depending on whether the actual value is higher, lower, or unchanged compared to the trend (previous) value. Thresholds define the ranges for red, yellow, and green statuses.
Syntax:
$olap.setTableColumnTrendImage( "table_id", "column_id", "trend_field", "real_field", "red_icon", "yellow_icon", "green_icon", "yellow_limit", "green_limit")Example:
$olap.setTableColumnTrendImage( "top_5_product_groups", "sales_ytd", "SUM(CASE WHEN [invoice_month] IN ?period.getCP_YTD(-1) THEN [invoiced_amount_dcur] ELSE 0 END)", "SUM(CASE WHEN [invoice_month] IN ?period.getCP_YTD() THEN [invoiced_amount_dcur] ELSE 0 END)", "caret_down", "caret_right", "caret_up", "10000000", "5000000")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id | Yes | The unique identifier of the column to update |
trend_value | Yes | Defines the trend (previous) value of the column. Typically used for comparison with the actual value |
real_value | Yes | Defines the actual (realized) value of the column to be compared against the target. Typically contains the expression for the current performance metric |
red_icon | Yes | Icon displayed when the column value is below the yellow limit |
yellow_icon | Yes | Icon displayed when the column value is between the yellow and green limits |
green_icon | Yes | Icon displayed when the column value exceeds the green limit |
yellow_limit | Yes | Threshold value defining the boundary between red and yellow status |
green_limit | Yes | Threshold value defining the boundary between yellow and green status |
setTableColumnProgress
Section titled “setTableColumnProgress”Adds a visual progress bar to a specified table column. This progress bar dynamically changes color based on defined threshold values, allowing users to instantly assess data performance relative to the set limits.
Syntax:
$olap.setTableColumnProgress( "table_id", "column_id", "yellow_limit", "green_limit")Example:
$olap.setTableColumnProgress( "top_5_product_groups", "sales_ytd", "10000000", "5000000")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_id | Yes | The unique identifier of the column to update |
yellow_limit | Yes | Threshold value defining the boundary between red and yellow status |
green_limit | Yes | Threshold value defining the boundary between yellow and green status |
setTableKpiColors
Section titled “setTableKpiColors”Sets custom colors for KPI-style visual indicators within a table. These colors define how data is highlighted based on thresholds, helping users quickly identify performance status (e.g., red = poor, green = good).
Syntax:
$olap.setTableKpiColors( "table_id", "blue_color", "green_color", "orange_color", "red_color")Example:
$olap.setTableKpiColors( "top_5_product_groups", "blue", "green", "orange", "red")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
green_color | Yes | The color for KPI values above green_budget_rate (good performance) |
yellow_color | Yes | The color for KPI values between yellow_budget_rate and green_budget_rate (warning) |
red_color | Yes | The color for KPI values below yellow_budget_rate (poor performance) |
setTableUrlLink
Section titled “setTableUrlLink”Adds a clickable link icon to each row in the table. When the user clicks the icon, they are redirected to the internal URL specified in the corresponding data field.
Syntax:
$olap.setTableUrlLink( "table_id", "internal_url")Example:
$olap.setTableUrlLink( "top_5_product_groups", "[account_url]")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
internal_url | Yes | The clickable link. Must reference a column from the data source containing a part of or the full internal URL. Example for a row: x35_109 or http://localhost:18080/demo/ui#!x35_109 |
setTableInfoLink
Section titled “setTableInfoLink”Adds a folder icon behind each row in the table. When users hover over the icon, they see additional text, and clicking the icon navigates to a report, issue or another internal URL.
Syntax:
$olap.setTableInfoLink( "table_id", "hover_info", "internal_url")Example:
$olap.setTableInfoLink( "top_5_product_groups", "[payer]", "[account_url]")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
hover_info | No | Text that appears when hovering over the info icon. Must reference a column from the data source |
internal_url | No | The clickable link. Must reference a column from the data source containing a part of or the full internal URL. Example for a row: x35_109 or http://localhost:18080/demo/ui#!x35_109 |
setTableHeaderUrlLink
Section titled “setTableHeaderUrlLink”Adds a clickable link icon to the table header. When users click the table header, they are redirected to a report or another internal URL.
Syntax:
$olap.setTableHeaderUrlLink( "table_id", "internal_url")Example:
$olap.setTableHeaderUrlLink( "top_5_product_groups", "x35_109")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
internal_url | Yes | The clickable link. Part of or the full internal URL (e.g., report reference). The full internal URL in the example: http://localhost:18080/demo/ui#!x35_109 |
setTableExternalUrlLink
Section titled “setTableExternalUrlLink”Adds a clickable link icon to the table header. When users click the table header, they are redirected to an external URL.
Syntax:
$olap.setTableExternalUrlLink( "table_id", "external_url")Example:
$olap.setTableExternalUrlLink( "top_5_customers", "https://example.com/invoice/12345")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
external_url | Yes | The clickable link. The full external URL |
setTableShowAllElements
Section titled “setTableShowAllElements”Controls how filters and OLAP actions (slice, dice, drill, and pivot) affect a table. You can choose whether the table responds to all filter scope, only header filters, or remains static.
Syntax:
$olap.setTableShowAllElements( "table_id", "olap_scope")Example:
$olap.setTableShowAllElements( "top_5_customers", "1")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
olap_scope | Yes | Defines which OLAP-actions affect the KPI. Valid arguments: 0 = Respond to all actions, 1 = Respond only to header actions, 2 = Respond only to report-level actions |
setTableSize
Section titled “setTableSize”Defines the width of a table widget for different screen sizes, using Bootstrap grid classes. This enables responsive layouts so tables look good on mobile, tablet, and desktop devices.
Syntax:
$olap.setTableSize( "table_id", "xs_size", "sm_size", "md_size", "lg_size")Example:
$olap.setTableSize( "top_5_product_groups", "XS12", "SM3", "MD3", "LG3")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
xs_size | Yes | Width of the table on extra small screens (mobile). Valid arguments: XS1, XS2, …, XS12 |
sm_size | Yes | Width of the table on small screens (tablets). Valid arguments: SM1, SM2, …, SM12 |
md_size | Yes | Width of the table on medium screens (desktops). Valid arguments: MD1, MD2, …, MD12 |
lg_size | Yes | Width of the table on large screens (large desktops). Valid arguments: LG1, LG2, …, LG12 |
setTableFixedFirstColumnWidth
Section titled “setTableFixedFirstColumnWidth”Fixes the width (in pixels) of the first column in the table.
Syntax:
$olap.setTableFixedFirstColumnWidth( "table_id", "column_width")Example:
$olap.setTableFixedFirstColumnWidth( "top_5_customers", "250")Parameters:
| Parameter | Required | Description |
|---|---|---|
table_id | Yes | The unique identifier of the table to update |
column_width | Yes | Width (in pixels) to apply to the first column |
Related
Section titled “Related”- Intro Tables - Overview of table documentation
- Table Examples - Practical examples
- Graphs, Tables and KPIs - Overview of all widgets