Months vs Years Cube
Sales across months and year
->pipe(new SuperCube(array(
"row" => "orderMonth",
"column" => "orderYear",
"sum" => "dollar_sales"
)))
Month | 2003 | 2004 | 2005 | Total |
January |
$95,920 |
$292,385 |
$307,737 |
$696,042 |
February |
$128,404 |
$289,503 |
$317,192 |
$735,099 |
March |
$160,517 |
$217,691 |
$359,712 |
$737,920 |
April |
$185,849 |
$187,576 |
$344,821 |
$718,245 |
May |
$179,436 |
$248,325 |
$441,475 |
$869,236 |
June |
$150,471 |
$343,371 |
$0 |
$493,842 |
July |
$201,940 |
$325,563 |
$0 |
$527,504 |
August |
$178,257 |
$419,327 |
$0 |
$597,584 |
September |
$236,698 |
$283,800 |
$0 |
$520,498 |
October |
$514,336 |
$500,234 |
$0 |
$1,014,570 |
November |
$988,025 |
$979,292 |
$0 |
$1,967,317 |
December |
$276,723 |
$428,838 |
$0 |
$705,561 |
The report demonstrate the use of `Cube` package to analyze data. The raw data is pulled from CSV file containing sale amount, orderDay, orderMonth and orderYear. The time information will act as dimension. Those data after is piped through `Cube` process will be turn to 2 dimension table in which row will be group by month, column is grouped by year and data cell is sale amount purchase in particular year and month.
Cube can be considered a simple version of Pivot Tables that you see in Excel or any Speadsheet application. The different between Cube and Pivot is the number of dimension they handle. While Pivot can handle more than 2 dimension and support hierachial demension, `Cube` support only 2 dimensions and single level of dimension. Although it sounds simple but according to our observation, 70% cases `Cube` is enough.
Because of the simplicity, the power of `Cube` process lie on its speed to handle data compared to Pivot.