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
-
columnWidths
Type: Array
Description: Array of one value determining the column widths. If omitted, a default value is used.
-1 equals auto.
-
qDimension
Type: Array
Description: Extends NxDimension, see Engine API: NxDimension.
Additional properties
-
qDef
Type: Object
Description: Extends NxInlineDimensionDef, see Engine API: NxInlineDimensionDef.
Name Type Description textAlign Object Properties
Name Type Description auto Boolean Can be one of:
- true
- false
Default: true
align String Can be one of:
- left
- right
- center
Default: left
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
Type: Array
Description: 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
Type: Array
Description: Extends NxMeasure, see Engine API: NxMeasure.
Additional properties
-
qDef
Type: Object
Description: Extends NxInlineMeasureDef, see Engine API: NxInlineMeasureDef.
Additional properties
Name Type Description textAlign Object Properties
Name Type Description auto Boolean Can be one of:
- true
- false
Default: true
align String Can be one of:
- left
- right
- center
Default: left
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
Type: 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
Type: Object
-
customErrorMessage
Type: Object
Description: Set to define custom error message:
- calcCond: String. Deprecated. Use qCalcCondition.qMsg instead.
Set to customize the calculation condition unfilled message.
search
Type: Object
Search settings for the list box.
Properties
Name | Type | Description |
---|---|---|
sorting | String |
The settings for sorting the values of a dimension in a list box. Can be one of:
|
components
Type: Array
Component settings. All theme component properties are unset (null) when creating a chart. The values for each attribute are fetched from the current theme. Setting any property here will override the theme used.
Properties
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
key | String |
Determines which component the settings apply to. Possible values: 'theme' |
|||||||||
content | Object |
Properties
|
|||||||||
Header | Object |
Properties
|
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");
});