Ticket #380 (closed enhancement: fixed)

Opened 10 months ago

Last modified 9 months ago

[PATCH] Simple pivot support

Reported by: ruport Assigned to: sandal
Milestone: ruport 1.4 defects Keywords:
Cc: ryan@platte.name

Description

This adds test-driven support for a Ruport::Data::Table#pivot method.

It's called thusly:

table.pivot('group_column', 'pivot_column', 'summary_column', :pivot_order => pivot_column_ordering_spec)

and returns a new table whose columns are the unique values of pivot_column, in the order specified by pivot_column_ordering_spec, populated with the correlated values in summary_column.

Attachments

pivot.patch (7.7 kB) - added by ruport on 01/31/08 18:08:20.
Add Ruport::Data::Table#pivot
pivot-take-2.patch (8.6 kB) - added by ruport on 02/03/08 16:45:03.
Add Ruport::Data::Table#pivot, incorporating feedback and adding documentation

Change History

01/31/08 18:08:20 changed by ruport

  • attachment pivot.patch added.

Add Ruport::Data::Table#pivot

02/02/08 12:46:57 changed by sandal

  • status changed from new to assigned.
  • owner set to sandal.

02/03/08 16:45:03 changed by ruport

  • attachment pivot-take-2.patch added.

Add Ruport::Data::Table#pivot, incorporating feedback and adding documentation

02/03/08 16:50:48 changed by ruport

I uploaded a second draft of this patch. It

  • changes Table#pivot to an option-based syntax
  • removes unnecessary tests
  • changes tests that depended on the output of the string formatter to instead just compare equality with another Table, and
  • adds API documentation with an example.

02/29/08 11:41:16 changed by sandal

  • status changed from assigned to closed.
  • resolution set to fixed.

whoops, checked this in a while ago.

03/03/08 20:55:33 changed by sandal

  • milestone changed from ruport 1.4 changes to ruport 1.4 defects.

Milestone ruport 1.4 changes deleted