HomeDatabase raw data and structureDBIx::SQLCrosstab documentation and source codeDBIx::SQLCrosstab CPAN distribution

DBIx::SQLCrosstab Example

SUM (salary) in personnel by area/country/location and dept/category/gender

areacountrylocationperssalesdevtotal
employeecontractortotalemployeecontractorconsultanttotalemployeeconsultanttotal
fmtotalmtotalmtotalmtotalftotalmtotalftotal
NorthGermanyBerlin5,50005,500005,50000000006,0006,000006,00011,500
Bonn0000005,0005,00000005,000000005,000
Munich05,0005,000005,00000005,5005,5005,5000000010,500
total5,5005,00010,5000010,5005,0005,000005,5005,50010,5006,0006,000006,00027,000
UKLondon0005,0005,0005,000005,5005,500005,5000000010,500
total0005,0005,0005,000005,5005,500005,5000000010,500
totaltotal5,5005,00010,5005,0005,00015,5005,0005,0005,5005,5005,5005,50016,0006,0006,000006,00037,500
SouthItalyRome06,0006,000006,0000000000006,0006,0006,00012,000
total06,0006,000006,0000000000006,0006,0006,00012,000
totaltotal06,0006,000006,0000000000006,0006,0006,00012,000
totaltotaltotal5,50011,00016,5005,0005,00021,5005,0005,0005,5005,5005,5005,50016,0006,0006,0006,0006,00012,00049,500

Operation

COUNT
SUM
AVG
MIN
MAX

Rows

area
country
location

Columns

dept
category
gender

Exclude from dept

pers
sales
dev

Exclude from category

employee
consultant
contractor

Exclude from gender

m
f

Additional operations

COUNTSUMAVGMINMAX

Query options

add_colors
add_real_names
col_sub_total
col_total
commify
remove_if_null
remove_if_zero
row_sub_total
row_total
title_in_header
use_real_names

Additional formats

none
list of lists
list of (simple) hashes
list of (tree-like) hashes
hash of hashes (tree)
Comma separated values (CSV)
YAML
XML
simple HTML table
SQL
SQL (highlighted syntax)
crosstab parameters


HomeDatabase raw data and structureDBIx::SQLCrosstab documentation and source codeDBIx::SQLCrosstab CPAN distribution