Saturday, February 10, 2018

Pivot Table plugin for APEX (Updated)

Some years ago I created an APEX region plugin for displaying the results of a query as a Pivot Table. You can read the original blog post about that here.

The plugin proved quite popular, but people were having problems using it with APEX 5 due to a jQuery versioning conflict.

I've now updated the plugin so it works with APEX, both 5.0 and 5.1.

To use it, simply add a region to the page, change the region type to "Pivot Table" and write an SQL query as the region source:

On the region attributes page, specify the options. I've added some help text to explain the various options. Note that you can have more than one Pivot Table region on the same page, but be sure to use a unique name in the "DOM Element Name" attribute for each pivot table.

I've also added/enabled some extra features such as spreadsheet export (via TSV - tab separated values) and charting.

It should be noted that the plugin is just an APEX wrapper for the Javascript Pivot Table component by Nicolas Kruchten who did all the hard work. I merely packaged it up for use with APEX.

You can download the plugin from my APEX plugins page. Enjoy! :-)


Paul Turley said...

Hi Morten,

Great plugin. Is it possible to use column aliases in the Default Column(s) section. For example SELECT JOB_NAME "Job Name" from JOB? I have tried then to add "Job Name" in the column name aliases but doesn't seem to work.



Wayne len said...

May I know how to default aggregation - SUM?
Thank you.

Unknown said...


I have the same question
May I know how to default aggregation - SUM?


Anonymous said...

May I know how to default aggregation - SUM?
Thank you.

PaulP said...

Where do I go for support? I have a number of questions regarding caching data and performance.

Anonymous said...

in order to change default aggregation i used the following js code on page load:

var x = document.getElementsByClassName("pvtAggregator");
x[0].value = "Sum";