# ------------------------------------------------------------- # sample for xtab.pl # creates a cross-tabulation having months as rows # and summary of sales by category as columns # ------------------------------------------------------------- # usage: perl xtab.pl < month-category-sales.xtab [| mysql -t ] # ------------------------------------------------------------- title=month-category-sales database=xcompany row_name=DATE_FORMAT(sale_date,"%M %Y") row_alias=month col_name=cat_code col_alias=category col_value=sale_amount col_from=FROM categories col_where= col_order=ORDER BY cat_sort_order row_from=FROM sales row_where= row_order=ORDER BY DATE_FORMAT(sale_date,"%Y%m") row_group=group by month