vdl-pivottable
The VDL Pivot Table component is a VDL Extension that provides an interface for users to create interactive pivot tables. Pivot tables are a powerful tool for analyzing and summarizing large datasets. The component allows users to visualize and manipulate data in a variety of ways, such as filtering, sorting, and aggregating data. Pivot Table requires grouped data to be passed via the data attribute e.g:
[
{ key: [1, 1, 'UK'], value: 100},
{ key: [1, 2, 'USA'], value: 200},
{ key: [1, 2, 'FR'], value: 300},
...
]
VDL actions are available to fetch, group, aggregate and label data.
since 5.2Example
<vdl-var name="groupedData" value="=[]"></vdl-var>
<vdl-var name="indexSetNames" value="=[]"></vdl-var>
<vdl-var name="labelArrays" value="=[]"></vdl-var>
<vdl-action-group name="getData">
<vdl-action-get-entity-data entity="CountryStats"></vdl-action-get-entity-data>
<vdl-action-group-by set-position="=[2,0,1]"></vdl-action-group-by>
<vdl-action-aggregate></vdl-action-aggregate>
<vdl-action-set-var var="groupedData"></vdl-action-set-var>
<vdl-action-get-index-sets entity="CountryStats"></vdl-action-get-index-sets>
<vdl-action-set-var var="indexSetNames"></vdl-action-set-var>
<vdl-action command="getLabelArray" vdl-repeat="=name in vars.indexSetNames" value="=name"></vdl-action>
</vdl-action-group>
<vdl-action-group name="getLabelArray">
<vdl-action-get-entity-data entity="=value" with-labels="true"></vdl-action-get-entity-data>
<vdl-action-array-push var="labelArrays"></vdl-action-array-push>
</vdl-action-group>
<vdlx-pivotgrid
data="=vars.groupedData"
row-dimensions="=['Match']"
column-dimensions="=['Country', 'Stat']"
column-titles="=[vars.labelArrays[0],vars.labelArrays[1]]"></vdlx-pivotgrid>
Attributes
always-show-selection | Whether to display selection on inactive grids. Set to true to keep selection on a grid when it becomes inactive. | since 5.2 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class | Space-separated list of the classes of the element. | since 5.2 | |||||||||||
column-dimensions | Used to define the dimensions pivoted onto the columns. Supported format: An array of column group headings ["pivot column a", "pivot column b"] , or a number representing the number of dimensions from the original data set that will be used as columns in the pivot grid. Both would result in two columns groups, but only the array of strings would result in the groups having headings. Pivoting will always be done by row first, then by column. If "column-set-positions" are also set, "column-dimensions" will only set column group headings. |
since 5.2 | accepts expression | ||||||||||
column-set-position | The position of the keys that are used to produce the columns of the pivot grid. You can specify a single value or an array. For example: key[x,y,z] to pivot by y column-set-position="1" , or to pivot by z and x column-set-position="=[2,0]" . |
since 5.2 | accepts expression | ||||||||||
column-titles | An array of arrays used to decorate the column titles, supported formats are; Array of strings ["Column 1", "Column 2"] , or an array of value/label objects: [{value:x label: "x label"}] . One array per dimension. When using the value/label array, the value represents the column index and the label the string that will be used to for the column heading. |
since 5.2 | accepts expression | ||||||||||
data | Use this attribute to pass data directly to vdl-pivottable. Supported formats: Array of key/value objects: [{key:[x,y] value: z}] |
since 5.2 | requires expression | ||||||||||
height | Grid height, When page-mode is set to scrolling you can set the height of the grid to something other than the default. | since 5.2 | accepts expression | ||||||||||
id | Specify an element id for the grid. Useful if you later want to target the grid using a selector. If not given then an id will be generated. | since 5.2 | |||||||||||
page-mode | By default the grid will show all rows in scrolling mode. Set this attribute to paged to enable grid pagination. | since 5.2 | |||||||||||
page-size | The number of rows to show per-page in paged mode. | since 5.2 | accepts expression | ||||||||||
row-dimensions | Used to define the dimensions pivoted onto the rows. Supported format: An array of row group headings ["pivot column a", "pivot column b"] , or a number representing the number of dimensions from the original data set that will be used as rows in the pivot grid. Both would result in two row groups, but only the array of strings would result in the groups having headings. Pivoting will always be done by row first, then by column. When used in conjunction with "row-set-positions", "row-dimensions" will only set the row group headings. |
since 5.2 | accepts expression | ||||||||||
row-filter | Expression to be used for filtering the rows of a <vdl-datagrid>. This must be an expression and should resolve to either a function or a boolean value. If a function it will be executed when grid updates. The function will have the following signature (rowData, indices) and should return a boolean.
|
since 5.2 | requires expression | ||||||||||
row-set-position | The position of the key or keys you wish to pivot onto the rows. You can specify a single value or an array. For example: key[x,y,z] to pivot by y row-set-position="1" , or to pivot by z and x row-set-position="=[2,0]" . The default value is 0. |
since 5.2 | accepts expression | ||||||||||
row-titles | An array of arrays used to decorate the row titles, supported formats are; Array of strings ["Column 1", "Column 2"] , or an array of value/label objects: [{value:x label: "x label"}] . One array per dimension. |
since 5.2 | accepts expression | ||||||||||
show-column-calc | Display a calculated cell displaying the total for each column. | since 5.2 | accepts expression | ||||||||||
show-row-calc | Display a calculated cell displaying the total for each row. | since 5.2 | accepts expression | ||||||||||
width | Set the grid to a fixed width, in pixels. Accepts an integer value. If set to the string custom then the grid width is calculated by adding up all the widths of the columns in the grid. If a column doesn't have a width specified then it is given a default value of 100px. | since 5.2 |
© 2001-2023 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.