Created on 19 December 2015
icon_unfollowing
Login to follow
pivot-table

Pivot Table - Traditional

Stable version 2.0.4 (Compatible with OutSystems 11)
Other versions available for 10 and Older
Uploaded on 10 November 2019 by 
Gonçalo Borrêga
pivot-table

Pivot Table - Traditional

Documentation
2.0.4

This is an example of how to use the pivot table with a relational database.


Step1: Setup  the Northwind Database. 

In this case I've added the external database with the Integration Studio.

Then add it as a dependency of your project 

Your database should look like this:


Step2: Install the Pivot table component and add it as dependency of your project:

For this example I've chosen the following elements:


Step3: Create a new screen, name it Pivot Table. 

3.1. Prepare this data (if you are working in Traditional):


The Aggregate should look like this:


3.2. Drag the Pivot Table Widget to the screen:


Assign the OrderDetailTable.Id to the SourceTableWidgetId.

The OnNotify is mandatory: this action refreshes the Pivot widget.

You can also drag a ShowHide block but is optional.



4. In your Browser, go to the Pivot Table web page.

You can now start drilling down the data with a pivot table by:

4.1. dragging the available entities to the greyed column or row areas;

4.2. selecting the chart type;

4.3. selecting the aggregation (COUNT, SUM, etc.);

4.4. a new input box appears: now choose the aggregated variable (eg. sales, discounts).


Example1:

Verify that in the charts types you will get the upper right menu when you hover the graph.


Example 2:

After setting up your pivot table entities you can also use the embedded filter function (start by selecting none):

Drill Down Table: Monthly sales by Employee for each Product, categorized by Supplier and Supplier Country


5. (Optional) Confirm the calculations from the Pivot are all correct, using a CRUD model and the Data Grid.


I have scaffolded the model so you can aggregate the the data for simple SUM operations.

The List Icon will forward you to more details 

(in this case, the specified Supplier's Product list)


When you click the shopping cart icon you will get the SUM for that particular table / page.

That must be equal to SUM you get from a simple aggregation with the Pivot Table.


You can also go to the Data Grid (read) component page, apply the exact same filters of you pivot table and extract an excel file where you can perform verifications. 


The demo used for this step-by-step is not (yet) included in the install but you can request it here in the support:

Pivot Table with Relational Database 



Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
Pivot Table - Traditional has no dependencies.