|
Odyssey
|
Public Member Functions | |
| __construct () | |
| GetCTE () | |
| GetColumnSQL ($toBeSummed) | |
| GetColumns ($columnArray) | |
| __construct () | |
| getCTE () | |
| getColumnSQL ($toBeSummed) | |
| getColumns ($columnArray) | |
Private Attributes | |
| $pivotArray | |
| $cte | |
| $columnSQLArray | |
class PivotCTE NOTE: Odyssey only. This is in Mammoth to keep this file in sync but it can only be used in Odyssey. Mammoth uses a prior version of Postgres that doesn't have support for Common Table Expressions (CTEs).
This class represents the CTE for months. It replaces the culogtrack_pivot which has the current month plus the past 12 months. There is a column per month and quarter which is zero or one.
class PivotCTE NOTE: Odyssey only. This is in Mammoth to keep this file in sync but it can only be used in Odyssey because Mammoth uses a prior version of Postgres that doesn't have support for Common Table Expressions (CTEs).
This class represents the CTE for months. It replaces the culogtrack_pivot which has the current month plus the past 12 months. There is a column per month and quarter which is zero or one.
Definition at line 75 of file reporting.i.
| PivotCTE::__construct | ( | ) |
function __construct()
This function gets the current timestamp, strips out everything but the year and the month, and then fills in the pivotArray values based on that. The pivotArray will have 13 records: 12 months ago to the current month. Each record has the date as varchar Ym, title as "Jan", "Feb", etc., months as an array of zeroes and ones– the ones will be the month that that date corresponds to, quarters as an array of zeroes and ones – the ones will be the quarter that the date corresponds to.
Definition at line 93 of file reporting.i.
| PivotCTE::__construct | ( | ) |
function __construct()
This function gets the current timestamp, strips out everything but the year and the month, and then fills in the pivotArray values based on that. The pivotArray will have 13 records: 12 months ago to the current month. Each record has the date as varchar Ym, title as "Jan", "Feb", etc., months as an array of zeroes and ones– the ones will be the month that that date corresponds to, quarters as an array of zeroes and ones – the ones will be the quarter that the date corresponds to.
| PivotCTE::getColumns | ( | $columnArray | ) |
public function getColumns($columnArray)
This function gets the column list.
| array | $columnArray | – Set the column list as usual here minus the columns for the pivot. |
| PivotCTE::GetColumns | ( | $columnArray | ) |
public function GetColumns($columnArray) This function gets the column list.
| array | $columnArray | – Set the column list as usual here minus the columns for the pivot. |
Definition at line 163 of file reporting.i.
| PivotCTE::getColumnSQL | ( | $toBeSummed | ) |
public function getColumnSQL($toBeSummed)
This function gets the SQL for the columns. Each column looks like "sum($toBeSummed * monthColumn)".
| string | $toBeSummed | – This is what needs to be summed to be summed by month. |
Definition at line 99 of file reports.i.
| PivotCTE::GetColumnSQL | ( | $toBeSummed | ) |
public function GetColumnSQL($toBeSummed) This function gets the SQL for the columns. Each column looks like "sum($toBeSummed * monthColumn)".
| string | $toBeSummed | – This is what needs to be summed to be summed by month. |
Definition at line 142 of file reporting.i.
| PivotCTE::getCTE | ( | ) |
public function getCTE()
This function gets the WITH clause to the SQL. It uses the "values" syntax and gets all the values from the pivotArray. If the CTE is already calculated, then it just returns that.
| PivotCTE::GetCTE | ( | ) |
public function GetCTE() This function gets the WITH clause to the SQL. It uses the "values" syntax and gets all the values from the pivotArray. If the CTE is already calculated, then it just returns that.
Definition at line 121 of file reporting.i.
1.8.15