History: PluginPivotTable
Source of version: 46
Copy to clipboard
See also ((Front-ends to Tracker data)) ! Plugin PivotTable ''Introduced in ((Tiki16|Tiki 16.2))'' {DIV(class="lead")}Use this ((wiki plugin)) to create dashboards with summaries of data in Tiki objects through the ((Search and List from Unified Index|unified search index)) to produce a pivot table report of your choice. Initially this plugin works with ((Trackers|tracker data)), but other Tiki objects can be connected later with this plugin. Results for the variables of interest (tracker fields, as well as creation_date, modification_date and tracker_status of the items) are aggregated by criteria selected by the user. It produces the [http://nicolas.kruchten.com/pivottable|JavaScript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation from Nicolas Kruchten] with drag'n'drop (see [https://github.com/nicolaskruchten/pivottable/releases|the list of changes in each version]).{DIV} !! Parameters {pluginmanager plugin="pivottable"} Notes on __aggregateDetails__: * The aggregateDetails accepts multiple field names or permNames separated by colon. * The aggregateDetails parameter is also enabled by default and can be disabled setting aggregateDetails to an empty string. * Each item has the associated object_link available by default and clickable in the popup where the aggregateDetails field data is shown. ** It will work with other unified search index content entries (not only tracker items) but might be slow for large result sets. ** It is only activated if aggregateDetails is not disabled. Therefore, there is a workaround to disable this feature for large sets of data (e.g. containing several or hundreds of thousands of items). !! Basic Usage Basic usage requires just to provide the data source (e.g. a tracker with id 1: "__tracker:1__" since ((Tiki16)), or __activitystream__ also since ((Tiki19)) ), and the rest will be taken as default values by the pivot table plugin, and you will be able to edit it through the PivotTable UI itself. That will allow you to display all field names of the tracker, and will let you drag and drop them in rows or columns of the pivot table editor. That will cover most use cases. However, if your dataset is huge, or the tracker has many fields, and some of them carrying heavy data (long text fields, or big files/images attached to the tracker items in files tracker fields), you can use an advanced syntax to filter the number of items or reduce the amount of tracker fields exposed to the pivot table to work with, so that performance of the pivot table plugin is fast again. See below for "[#Advanced_Usage|Advanced Usage]" !!! Example 1 After installing the ((Profiles Wizard|Bug_Tracker_16 profile)) on a brand new Tiki 16, you will get a new tracker with id 1 to hold the data of the bug reports/issue tickets. When you add a few dozen items, you can use some syntax like the one indicated below to produce some demo pivot tables table with default values as a starting point, to let you start reviewing the data as wiki-wiki (quick) as possible. ''This code:'' {CODE(colors="tiki")} {pivottable data="tracker:1"} {CODE} ''Would produce with the data from that profile (at the time of this writing):'' {img src="display1310" link="display1310" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Once saved, you can click on any cell of the pivottable report, and you will be shown a popup with the information tracker items that produced the count for that cel, with a link to view the full record of each of the tracker items. {img src="display1323" link="display1323" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} From there we can edit the Pivottable again through the PivotTable UI itself, and modify the variables to be used as row or column data, or add new variables in columns, change the type of table or chart produced, etc. A table can even consider more than one value in a single dimension. The following example therefore uses both Status and Priority on the horizontal axis (meaning a column can have subcolumns): {img src="display1311" link="display1311" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Example 2 A default configuration for each parameter of the plugin can also be specified. For instance, the values considered in both dimensions can be specified, using the ''rows'' and ''cols'' parameters, as in the following example (which considers 2 values on the horizontal axis, as in the previous screenshot). ''This code:'' {CODE(colors="tiki")} {PIVOTTABLE(data="tracker:1" width="100%" height="500px" rows="bug_tracker_severity" cols="bug_tracker_bug_status:bug_tracker_priority" rendererName="Heatmap" aggregatorName="Count as Fraction of Columns" vals="bug_tracker_priority")} {PIVOTTABLE} {CODE} ''Would produce with the data from that profile (at the time of this writing):'' {img src="display1312" link="display1312" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Example 3 You can also make some charts: * Line Chart * Bar Chart * Stacked Bar Chart * Area Chart * Scatter Chart For instance... ''This code:'' {CODE(colors="tiki")} {PIVOTTABLE(data="tracker:1" width="400px" height="300px" rows="bug_tracker_severity" cols="bug_tracker_bug_status" rendererName="Stacked Bar Chart" aggregatorName="Count")} {PIVOTTABLE} {CODE} ''Would produce:'' {img src="display1337" link="display1337" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Example 4 (subtotals since Tiki 18) Since ((Tiki18)) new renderers were added to allow displaying subtotal sums for rows in the table, through the [https://sourceforge.net/p/tikiwiki/code/63010|addition] of [http://nagarajanchinnasamy.com/subtotal/|subtotal.js] to the plugin: * Table With Subtotal * Table With Subtotal Bar Chart * Table With Subtotal Heatmap * Table With Subtotal Row Heatmap * Table With Subtotal Col Heatmap {img src="display1383" link="display1383" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} If you click on the triangle at the left of each row name ("Severity" values, in this example), you will get the options of the next column ("Bug Status", in this example) contracted, hiding the different values of this other column, and showing only the subtotals for the field where you first clicked at (a "severity" value, or the whole column "Severity"). {img src="display1384" link="display1384" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Example 5 (activity stream since Tiki19) Since ((Tiki19)), you can display data from the ((PluginActivityStream)) into the Plugin PivotTable. Minimum syntax to let the user choose options throught the PivotTable UI: {CODE()} {pivottable data="activitystream"} {CODE} Example: {CODE()} {pivottable data="activitystream" rows="object:type" cols="modification_date" width="100%" height="1000px" rendererName="Bar Chart" aggregatorName="Count" inclusions="{}" menuLimit="500" aggregateDetails="object_type"} {CODE} !! Advanced Usage If your dataset is huge (many thousands), or the tracker has many fields (many hundreds), and some of them carrying heavy data (long text fields, or big files/images attached to the tracker items in files tracker fields), you can use an advanced syntax to filter the number of items or reduce the amount of tracker fields exposed to the pivot table to work with, so that the good performance of the pivot table plugin is preserved. You can use the __filter__ or __display__ commands (both from ((PluginList)) ) to indicate which items (filter) or tracker fields (display) you want to use, respectively, in the pivot table plugin. Example: {CODE(colors="tiki")} {display name="tracker_field_JobType"} {CODE} See: * ((PluginList filter control block)) * ((PluginList display control block)) !!! Add creation_date, modification_date and status You can also indicate if you want the creation_date, modification_date and status if the tracker items to be displayed as optional variables to be used in the report. {CODE(colors="tiki")} {display name="creation_date" format="datetime"} {display name="modification_date" format="datetime"} {display name="tracker_status"} {CODE} !!! Customize aggregation date values See ((Derived Attribute of a date)) !!! Advanced Example 1 ''This code:'' {CODE(colors="tiki")} {PIVOTTABLE(data="tracker:4" rows="bug_tracker_submitted_by:bug_tracker_severity:" cols="bug_tracker_bug_status:bug_tracker_priority:" rendererName="Heatmap" aggregatorName="Count as Fraction of Total")} {display name="tracker_field_bug_tracker_submitted_by" default=""} {display name="tracker_field_bug_tracker_severity" default=""} {display name="tracker_field_bug_tracker_bug_status" default=""} {display name="tracker_field_bug_tracker_priority" default=""} {display name="tracker_field_bug_tracker_version" default=""} {PIVOTTABLE} {CODE} ''Would produce with the data from that profile (at the time of this writing):'' {img src="display1318" link="display1318" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} And once you click at the __Edit Pivot Table__ button, you would see the controls to edit variable selection, but notice that you have less amount of variables to choose from than before; only the ones you have selected in the display commands of the plugin body above: {img src="display1319" link="display1319" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Advanced example 2 ''This code:'' {CODE(colors="tiki")} {PIVOTTABLE(data="tracker:4" rows="bug_tracker_submitted_by:bug_tracker_severity:" cols="bug_tracker_bug_status:bug_tracker_priority:" rendererName="Heatmap" aggregatorName="Count as Fraction of Total")} {filter field="tracker_field_bug_tracker_bug_status" content="new"} {display name="tracker_field_bug_tracker_submitted_by" default=""} {display name="tracker_field_bug_tracker_severity" default=""} {display name="tracker_field_bug_tracker_bug_status" default=""} {display name="tracker_field_bug_tracker_priority" default=""} {display name="tracker_field_bug_tracker_version" default=""} {PIVOTTABLE} {CODE} ''Would produce the same as before, but restricting the data set to only those items tagged as new bugs (bug status is "new"):'' {img src="display1320" link="display1320" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Again, if you edit the pivot table, you will see that also have the restricted the number of fields, as well as the data points, that comply with your filtering criteria: {img src="display1324" link="display1324" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !!! Advanced example 3 Since Tiki 16.2, any plugin using unified index search formatter and wikibuilder (aka filter, output, display, format, etc. wiki syntax, such as ((PluginPivottable)) ) now accepts -+{filter field=... editable=...}+- syntax to allow user enter a search value instead of hard-coding it. This means a trackerfilter-like functionality for unified index-based plugins. You can see this feature in action if you apply profile ((pr:Bug_Tracker_16)) ''Therefore, this code:'' {CODE(colors="tiki")} {PIVOTTABLE(data="tracker:4" rows="bug_tracker_severity" cols="bug_tracker_bug_status" rendererName="Heatmap" aggregatorName="Count")} {filter field="tracker_field_bug_tracker_priority" editable="content"} {filter field="tracker_field_bug_tracker_assignee" editable="content"} {filter field="tracker_field_bug_tracker_summary" editable="content"} {PIVOTTABLE} {CODE} ''Would produce the expected pivottable report, with some fields on top to allow the user to filter results before re-drawing the table or chart:'' {img src="display1338" link="display1338" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !! Related pages * ((Grouped Data)) * ((Derived Attribute of a date)) * ((Profiles Wizard)) * ((Trackers)) * [http://nicolas.kruchten.com/pivottable/] !! Aliases (alias(Plugin Pivot Table)) | (alias(Plugin PivotTable)) | (alias(PluginPivot Table)) | (alias(Pivot Table)) | (alias(PivotTable)) | (alias(Plugin Pivot Tables)) | (alias(Plugin PivotTables)) | (alias(PluginPivot Tables)) | (alias(Pivot Tables)) | (alias(PivotTables)) | (alias(Plugin Data Pilot)) | (alias(Plugin DataPilot)) | (alias(PluginData Pilot)) | (alias(Data Pilot)) | (alias(Data Pilot)) |