pivot-table properties

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

pivot-table()

These are the properties used by Qlik Sense pivot 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 | qStringExpression

Visualization title shown if "showTitles": true.

subtitle

Type: String | qStringExpression

Visualization subtitle shown if "showTitles": true.

footnote

Type: String | qStringExpression

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
columnWidths Array

Array of one value determining the column widths. If omitted, a default value is used.

-1 equals 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
autoSort Boolean

Set to automatically sort the dimension.

Default: true

cID String ID used by the client. Must be unique within the current chart.
othersLabel StringExpressionContainer
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
autoSort Boolean

Set to automatically sort the measure.

Default: true

cID String ID used by the client. Must be unique within the current chart.
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.

Example using Visualization API

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

In this example we create a basic pivot table, containing two dimensions (Year and Quarter) and three measures. The measures have basic number formatting applied and a title is added to the pivot table.

app.visualization.create(
  'pivot-table',
  [
    {
      "qDef": {
        "qFieldDefs": [
          "Date.autoCalendar.Year"
        ],
        "qFieldLabels": [
          "Year"
        ]
      },
      "qNullSuppression": true
    },
    {
      "qDef": {
        "qFieldDefs": [
          "Date.autoCalendar.Quarter"
        ],
        "qFieldLabels": [
          "Quarter"
        ]
      },
      "qNullSuppression": true
    },
    {
      "qDef": {
        "qLabel": "FIR%",
        "qDef": "Avg(FwHit)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "0.0%",
          "qDec": ".",
          "qThou": ","
        }
      }
    },
    {
      "qDef": {
        "qLabel": "GIR%",
        "qDef": "Avg(GIR)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "0.0%",
          "qDec": ".",
          "qThou": ","
        }
      }
    },
    {
      "qDef": {
        "qLabel": "Putt avg",
        "qDef": "Avg(Putts)",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "#,##0.00",
          "qDec": ".",
          "qThou": ","
        }
      }
    }
  ],
  {
    "showTitles": true,
    "title": "Golf statistics"
  }
).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?