| | |
| | | localColumnHandle := localColumnIndexTree.GetHandle( column.StartDate().AsQUILL() ); |
| | | localColumnIndex := guard( localColumnIndexTree.Root().Child( localColumnHandle ),null( NamedValue )); |
| | | if( isnull( localColumnIndex )){ |
| | | localColumn := table.LocalColumn( relnew,CustomDate := column.StartDate()); |
| | | localColumn := table.LocalColumn( relnew,CustomDate := column.StartDate(),TimeUnit := "Day"); |
| | | localColumns.Add( localColumn ); |
| | | localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 ); |
| | | } |
| | |
| | | localColumnHandle := localColumnIndexTree.GetHandle( column.StartDate().AsQUILL() ); |
| | | localColumnIndex := guard( localColumnIndexTree.Root().Child( localColumnHandle ),null( NamedValue )); |
| | | if( isnull( localColumnIndex )){ |
| | | localColumn := table.LocalColumn( relnew,CustomDate := column.StartDate()); |
| | | localColumn := table.LocalColumn( relnew,CustomDate := column.StartDate(),TimeUnit := "Day"); |
| | | localColumns.Add( localColumn ); |
| | | localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 ); |
| | | } |
| | |
| | | CompareVersion := ifexpr( isnull( compareOfflinePlanCell),0.0,compareOfflinePlanCell.Quantity())); |
| | | } |
| | | } |
| | | |
| | | startDate := minselect( table,LocalColumn,localColumn,localColumn.CustomDate() ).CustomDate(); |
| | | endDate := maxselect( table,LocalColumn,localColumn,localColumn.CustomDate() ).CustomDate(); |
| | | for( i := startDate.StartOfWeek(); i <= endDate.StartOfNextWeek(); i := i.StartOfNextWeek() ){ |
| | | timeUnit := "Week"; |
| | | localColumnHandle := localColumnIndexTree.GetHandle( i.AsQUILL() + timeUnit); |
| | | localColumn := table.LocalColumn( relnew,CustomDate := i,TimeUnit := timeUnit ); |
| | | localColumns.Add( localColumn ); |
| | | localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 ); |
| | | } |
| | | for( i := startDate.StartOfMonth(); i <= endDate.StartOfNextMonth(); i := i.StartOfNextMonth() ){ |
| | | timeUnit := "Month"; |
| | | localColumnHandle := localColumnIndexTree.GetHandle( i.AsQUILL() + timeUnit); |
| | | localColumn := table.LocalColumn( relnew,CustomDate := i,TimeUnit := timeUnit ); |
| | | localColumns.Add( localColumn ); |
| | | localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 ); |
| | | } |
| | | |
| | | traverse( table,LocalRow,row ){ |
| | | traverse( table,LocalColumn,column,column.TimeUnit() = "Week"){ |
| | | baseVersionValue := sum( table,LocalRow.LocalCell.astype( LocalCell_OfflinePlanComparison ),cell, |
| | | cell.LocalColumn().TimeUnit() = "Day" and |
| | | cell.LocalColumn().CustomDate() >= column.CustomDate() and |
| | | cell.LocalColumn().CustomDate() < column.CustomDate().StartOfNextWeek(), cell.BaseVersionValue()); |
| | | compareVersionValue := sum( table,LocalRow.LocalCell.astype( LocalCell_OfflinePlanComparison ),cell, |
| | | cell.LocalColumn().TimeUnit() = "Day" and |
| | | cell.LocalColumn().CustomDate() >= column.CustomDate() and |
| | | cell.LocalColumn().CustomDate() < column.CustomDate().StartOfNextWeek(), cell.CompareVersionValue()); |
| | | |
| | | row.LocalCell(relnew,LocalCell_OfflinePlanComparison,LocalColumn := column,BaseVersionValue := baseVersionValue,CompareVersionValue := compareVersionValue ); |
| | | } |
| | | } |
| | | traverse( table,LocalRow,row ){ |
| | | traverse( table,LocalColumn,column,column.TimeUnit() = "Month "){ |
| | | baseVersionValue := sum( table,LocalRow.LocalCell.astype( LocalCell_OfflinePlanComparison ),cell, |
| | | cell.LocalColumn().TimeUnit() = "Day" and |
| | | cell.LocalColumn().CustomDate() >= column.CustomDate() and |
| | | cell.LocalColumn().CustomDate() < column.CustomDate().StartOfNextMonth(), cell.BaseVersionValue()); |
| | | compareVersionValue := sum( table,LocalRow.LocalCell.astype( LocalCell_OfflinePlanComparison ),cell, |
| | | cell.LocalColumn().TimeUnit() = "Day" and |
| | | cell.LocalColumn().CustomDate() >= column.CustomDate() and |
| | | cell.LocalColumn().CustomDate() < column.CustomDate().StartOfNextMonth(), cell.CompareVersionValue()); |
| | | |
| | | row.LocalCell(relnew,LocalCell_OfflinePlanComparison,LocalColumn := column,BaseVersionValue := baseVersionValue,CompareVersionValue := compareVersionValue ); |
| | | } |
| | | } |
| | | |
| | | traverse( table,LocalColumn,column ){ |
| | | if( column.LocalCell( relsize ) = 0 ){ |
| | | column.Delete(); |