table properties

Note: STABLE.
This API is reliable and breaking changes are unlikely.

table()

These are the properties used by Qlik Sense straight tables.

Version history

Introduced 2.2

Properties

showTitles

Type: Boolean

Show title for the visualization.

Default: true.

showDetails

Type: Boolean

Sets if visualization details should be shown.

Default: false

title

Type: String | Expression

Visualization title shown if "showTitles": true.

subtitle

Type: String | Expression

Visualization subtitle shown if "showTitles": true.

footnote

Type: String | Expression

Visualization footnote shown if "showTitles": true.

qHyperCubeDef

Type: Object

The hypercube definition used by most visualizations.

A subset of the properties available in the qHyperCubeDef is presented here. For complete documentation of all available properties, see Engine API: HyperCubeDef.

Properties

Name Type Description
columnOrder Array

Index array that determines the column order, where 0 is the first column, 1 is the second, and so on. If omitted, a default value will be used.

columnWidths Array

Array that determines the column widths. If omitted, a default value will be used.

-1 equals to auto.

qDimensions Array

Extends NxDimension, see Engine API: NxDimension.

Additional properties

Name Type Description
qDef Object

Extends NxInlineDimensionDef, see Engine API: NxInlineDimensionDef.

Additional properties

Name Type Description
textAlign Object

Properties

Name Type Description
auto Boolean Default: true
align String

Can be one of:

  • left
  • right

Default: left

representation Object

Can be one of:

Name Type Description
type String

Determines how column values are represented. One of:

  • text
  • url

Default: text

urlLabel String

Label to use when represented as url. Empty string displays the actual URL.

autoSort Boolean

Defines if the dimension should be auto-sorted.

Default: true

cID String  
othersLabel

StringExpressionContainer

Label for the others group if dimension limits are used.

qAttributeDimensions Array

Extends NxAttrDimDef, see Engine API: NxAttrDimDef.

Additional properties

Name Type Description
id String

One of:

  • cellBackgroundColor: for attribute expression, expression for background color of table cell.
  • cellForegroundColor: for attribute expression, expression for text color of table cell.
qMeasures Array

Extends NxMeasure, see Engine API: NxMeasure.

Additional properties

Name Type Description
qDef Object

Extends NxInlineMeasureDef, see Engine API: NxInlineMeasureDef.

Additional properties

Name Type Description
textAlign Object

Properties

Name Type Description
auto Boolean Default: true
align String

Can be one of:

  • left
  • right

Default: left

autoSort Boolean

Defines if the measure should be auto-sorted.

Default: true

numFormatFromTemplate Boolean

When enabled, the number format to use can be selected from multiple predefined formats based on the desired type: number or date.

Default: true

isCustomFormatted Boolean Set to true to toggle off the default client formatting.
qAttributeExpressions Array

Extends NxAttrExprDef, see Engine API: NxAttrExprDef.

Additional properties

Name Type Description
id String

One of:

  • cellBackgroundColor: for attribute expression, expression for background color of table cell.
  • cellForegroundColor: for attribute expression, expression for text color of table cell.
qLayoutExclude Object  
customErrorMessage Object

Set to define custom error messages.

Name Type Description
calcCond String

Deprecated. Use qCalcCondition.qMsg instead.

Set to customize the calculation condition unfilled message.

totals

Type: Object

Totals row settings.

Properties

Name Type Description
show Boolean

Set to automatically display totals row.

Default: true

position String

Set the position of the totals row. Can be one of:

  • noTotals
  • top
  • bottom

Default: noTotals

label String

Set the label of the totals row.

Default: Totals

scrolling

Type: Object

Settings related to scrolling behavior.

Properties added in Qlik Sense November 2017.

Properties

Name Type Description
keepFirstColumnInView Boolean

Specifies if the first column should be locked when the content is scrolled horizontally. Locking the first column allows to easily associate content in other columns with the objects represented in the rows.

Default: false

multiline

Type: Object

Header and text wrapping settings.

Properties added in Qlik Sense November 2017.

Properties

Name Type Description
wrapTextInHeaders Boolean

Set to true to enable text wrapping into multiple lines in the table headers. When disabled, the table headers appear more compact.

Default: true

wrapTextInCells Boolean

Set to true to enable text wrapping into multiple lines in the tables data cells. When disabled, the table cell content appear more compact and more rows can be shown on the screen.

Default: true

Example using Visualization API

Tip: For more examples of how to create tables on the fly, see Mashups: Creating tables.

In this example we create a basic table, containing one dimension and four measures. The measures have basic number formatting applied and the dimension is sorted by load order. No options are defined for the table.

app.visualization.create(
  'table',
  [
    {
      "qDef": {
        "qFieldDefs": [
          "=If(Par>3,TClubName)"
        ],
        "qFieldLabels": [
          "Tee club"
        ],
        "qSortCriterias": [
          {
            "qSortByLoadOrder": 1
          }
        ]
      },
      "qNullSuppression": true
    },
    {
      "qDef": {
        "qLabel": "#",
        "qDef": "Count(HoID)"
      }
    },
    {
      "qDef": {
        "qLabel": "FIR%",
        "qDef": "Avg(FwHit)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "0.0%",
          "qDec": ".",
          "qThou": ","
        }
      }
    },
    {
      "qDef": {
        "qLabel": "Avg",
        "qDef": "Avg(DrDist)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "#,##0.00 m",
          "qDec": ".",
          "qThou": ","
        },
        "numFormatFromTemplate": false
      }
    },
    {
      "qDef": {
        "qLabel": "Max",
        "qDef": "Max(DrDist)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "#,##0 m",
          "qDec": ".",
          "qThou": ","
        },
        "numFormatFromTemplate": false
      }
    }
  ],
  {
  }
).then(function(vis){
  vis.show("QV01");
});

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?