pivot-table properties
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
|
||||||||||||||||||||||||||||||
qMeasures | Array |
Extends NxMeasure, see Engine API: NxMeasure. Additional properties
|
||||||||||||||||||||||||||||||
qLayoutExclude | Object |
|
||||||||||||||||||||||||||||||
customErrorMessage | Object |
Set to define custom error messages.
|
Example using Visualization API
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");
});