Skip Menu |

This queue is for tickets about the DBIx-SQLCrosstab CPAN distribution.

Report information
The Basics
Id: 7408
Status: open
Priority: 0/
Queue: DBIx-SQLCrosstab

People
Owner: gmax [...] cpan.org
Requestors: wanded [...] breathemail.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Thu, 19 Aug 2004 12:36:23 +0100
From: Ed Wandasiewicz <wanded [...] breathemail.net>
To: bug-DBIx-SQLCrosstab [...] rt.cpan.org
CC: gmax [...] cpan.org
Subject: bug DBIx-SQLCrosstab 1.17
I am using DBIx-SQLCrosstab-1.17. I changed test.pl that came with the installation and set up the following my $col_names = [ 'name', 'location', 'color', 'low#low', 'low#high', 'high#high']; my $records = [ [ '*Fred*', '*A1*', '*red*', '0', '0', '10'], [ '*Fred*', '*A1*', '*black*', '1', '8'], [ '*Fred*', '*A1*', '*blue*', '0', '2'], [ '*Fred*', '*A2*', '*blue*', '1', '3'], [ '*Barney*', '*A1*', '*red*', '0', '3'], [ '*Barney*', '*A1*', '*blue', '1', '8'], [ '*Barney*', '*A2*', '*black*', '1', '5'], [ '*Barney*', '*A2*', '*blue*', '2', '0'], ]; I then asked for output as_html. I would like subgrouping along the rows by "name^location^color". It would seem you can only group by 2 different rows, maximum. e.g. name^location or name^color or location^color. The solution would be to set the other grouping in columns. Should you be able to group along rows as well, or was it not designed this way? Ed.
From: gmax
The so called "bug" you are reporting comes from the modification of a test script that is not supposed to be modified, as a clear warning on top of it says. The parameters in that script are related to the data, and the data is the outcome of a real query with real data. Please provide an example with database raw data and the appropriate parameters used, and if the outcome is not what you expect, then file a bug report. If you take the trouble of reading the docs (and perhaps the article I wrote for Onlamp), you'll see that what you ask is feasible. Moreover, the records you want to use could not be the result of a DB query.
From: wanded [...] breathemail.net
[guest - Fri Aug 20 04:30:35 2004]: Show quoted text
> > The so called "bug" you are reporting comes from the modification of a > test script that is not supposed to be modified, as a clear warning on > top of it says. The parameters in that script are related to the data, > and the data is the outcome of a real query with real data. > > Please provide an example with database raw data and the appropriate > parameters used, and if the outcome is not what you expect, then file a > bug report. > > If you take the trouble of reading the docs (and perhaps the article I > wrote for Onlamp), you'll see that what you ask is feasible. > > Moreover, the records you want to use could not be the result of a DB
query. Using the examples/sqlcrosstab_example.pl that comes with the DBIx-SQLCrosstab module, I tried the following $params configuration for $xtab1. If you view the output of table01.html, you will see the pers^employee^employee^m output. The Tree::DAG_Node cannot distinguish between pers^employee^female and pers^employee^male. ... $dbh or die "Error in connection [ driver $driver ] ($DBI::errstr)\n"; my $params = { dbh => $dbh, op => [['COUNT','person_id']] , title => 'TBD', title_in_header=> 1, remove_if_null => 1, # remove columns with all nulls remove_if_zero => 1, # remove columns with all zeroes add_colors => 1, # distinct colors for string and numbers add_real_names => 1, # real column name as comment in query col_total => 1, col_sub_total => 0, row_total => 0, row_sub_total => 0, commify => 1, # add thousand separating commas in numbers rows => [ { col => 'department'}, { col => 'category'}, { col => 'gender'} ], cols => [ { id => 'loc_id', value => 'loc', from => 'xtab_locations' }, ], from => qq{xtab_person INNER JOIN xtab_departments ON (xtab_person.dept_id=xtab_departments.dept_id) INNER JOIN xtab_categories ON (xtab_categories.cat_id=xtab_person.cat_id) }, }; $params->{title} = "personnel by " . (join "/", map {exists $_->{alias} ? $_->{alias} : $_->{col}} @{$params->{rows}} ) . " and " . (join "/", map {exists $_->{value} ? $_->{value} : $_->{id}} @{$params->{cols}} ); my $xtab1 = DBIx::SQLCrosstab::Format->new($params) ...