Skip to content

Table Method Overview

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:

ParameterRequiredDescription
table_idYesA user-defined unique identifier for this table. The table_id specified here must be passed as an argument to subsequent methods
title_labelYesThe text label displayed as the title of this table
iconYesA FontAwesome icon for the table. Available icons: FontAwesome
data_filterYesGeneral filter expression to limit which data is included for the table. Set to NULL if not required
row_limitYesThe limit number of rows (records) to display in the table. Set to NULL if not required

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
matrix_nameYesThe name of the alternative data source table or view
alias_keyNoThe connection key for an external database if the data source is in a different database

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_idYesA user-defined unique identifier for this column. The column_id specified here must be passed as an argument to subsequent methods
header_labelYesThe text label displayed as the header of this column
valueYesDefines the column value. Typically contains an expression for the current metric
value_formatYesThe 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
prefixNoText or symbol displayed before the column value (e.g., USD)
suffixNoText or symbol displayed after the column value (e.g., ex. tax)

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_idYesThe unique identifier of the column to update

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_id sort_directionYesThe unique identifier of the column to update and sort direction combined as a string. Valid arguments: asc = Ascending, desc = Descending

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_idYesThe unique identifier of the column to update
red_iconYesIcon displayed when the column value is below the yellow limit
yellow_iconYesIcon displayed when the column value is between the yellow and green limits
green_iconYesIcon displayed when the column value exceeds the green limit
yellow_limitYesThreshold value defining the boundary between red and yellow status
green_limitYesThreshold value defining the boundary between yellow and green status

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_idYesThe unique identifier of the column to update
trend_valueYesDefines the trend (previous) value of the column. Typically used for comparison with the actual value
real_valueYesDefines the actual (realized) value of the column to be compared against the target. Typically contains the expression for the current performance metric
red_iconYesIcon displayed when the column value is below the yellow limit
yellow_iconYesIcon displayed when the column value is between the yellow and green limits
green_iconYesIcon displayed when the column value exceeds the green limit
yellow_limitYesThreshold value defining the boundary between red and yellow status
green_limitYesThreshold value defining the boundary between yellow and green status

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_idYesThe unique identifier of the column to update
yellow_limitYesThreshold value defining the boundary between red and yellow status
green_limitYesThreshold value defining the boundary between yellow and green status

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
green_colorYesThe color for KPI values above green_budget_rate (good performance)
yellow_colorYesThe color for KPI values between yellow_budget_rate and green_budget_rate (warning)
red_colorYesThe color for KPI values below yellow_budget_rate (poor performance)

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
internal_urlYesThe 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

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
hover_infoNoText that appears when hovering over the info icon. Must reference a column from the data source
internal_urlNoThe 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

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
internal_urlYesThe 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

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
external_urlYesThe clickable link. The full external URL

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
olap_scopeYesDefines 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

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
xs_sizeYesWidth of the table on extra small screens (mobile). Valid arguments: XS1, XS2, …, XS12
sm_sizeYesWidth of the table on small screens (tablets). Valid arguments: SM1, SM2, …, SM12
md_sizeYesWidth of the table on medium screens (desktops). Valid arguments: MD1, MD2, …, MD12
lg_sizeYesWidth of the table on large screens (large desktops). Valid arguments: LG1, LG2, …, LG12

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:

ParameterRequiredDescription
table_idYesThe unique identifier of the table to update
column_widthYesWidth (in pixels) to apply to the first column