Refuses to be fed...hunger strike?
Posted: Wed May 14, 2014 4:27 am
Anybody ever come across a cube that refuses to be fed? This cube really has no N or C rules and uses ELLEV to get to the right levels of data. This is 3 years of daily rental rates for Rental Cars and Rental Equipment and whatnot - so we have to average the rates across time but aggregate the Equipment up to Category Class, etc and across Locations to Regions. So consequently we can get to all the right consolidated numbers, but most of it disappears upon zero suppress.
========
Skipcheck;
['Avg Contract Rate']=['RentalAmount']\['Count'];
# WAR calc weighted avg rate
['ACR for WAR'] = IF(ELLEV('Equipment',!Equipment)>1,ConsolidateChildren('Equipment'),continue);
['ACR for WAR'] = IF(ELLEV('Equipment',!Equipment)>0,
['Avg Contract Rate'] * DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count'),0);
# <<< This summarizes the Count for WAR (Weighted Average Rate = WAR) which is selectively grabbing rows based on logic below...
['Count for WAR'] = IF(ELLEV('Equipment',!Equipment)>1,ConsolidateChildren('Equipment'),continue);
# <<< This WAR calc is level 1 and above, hence the >0 level on Equip and IF there is Count in both 12MoAgo and in Current, then count the 12MoAgo...and use as divisor in current WAR calc.
['Count for WAR'] = IF(ELLEV('Equipment',!Equipment)>0 &
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count')<> 0 &
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count') <> 0,
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count'),continue);
## <<< This Current WAR calc gives the correct values but refuses to be fed!
['Current WAR'] = IF(ELLEV('Equipment',!Equipment)>0,
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'ACR for WAR')\
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count for WAR'),0);
Feeders;
#<<< this feeder works because Count and RentalAmount are both leaf level data brought into the cube >>>
['Count']=>['RentalAmount'], ['Avg Contract Rate'];
#<<< these two feeders below DO NOT WORK ... data disappears on zero suppress >>>
[{'Count','RentalAmount'}]=>['ACR for WAR'];
['Count'] => DB(IF(DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,
attrs('Time',!Time,'12MonthsAGO'),'Count')<>0,'Rate','NO FEED'),!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count for WAR');
========
Skipcheck;
['Avg Contract Rate']=['RentalAmount']\['Count'];
# WAR calc weighted avg rate
['ACR for WAR'] = IF(ELLEV('Equipment',!Equipment)>1,ConsolidateChildren('Equipment'),continue);
['ACR for WAR'] = IF(ELLEV('Equipment',!Equipment)>0,
['Avg Contract Rate'] * DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count'),0);
# <<< This summarizes the Count for WAR (Weighted Average Rate = WAR) which is selectively grabbing rows based on logic below...
['Count for WAR'] = IF(ELLEV('Equipment',!Equipment)>1,ConsolidateChildren('Equipment'),continue);
# <<< This WAR calc is level 1 and above, hence the >0 level on Equip and IF there is Count in both 12MoAgo and in Current, then count the 12MoAgo...and use as divisor in current WAR calc.
['Count for WAR'] = IF(ELLEV('Equipment',!Equipment)>0 &
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count')<> 0 &
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count') <> 0,
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsAGO'),'Count'),continue);
## <<< This Current WAR calc gives the correct values but refuses to be fed!
['Current WAR'] = IF(ELLEV('Equipment',!Equipment)>0,
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'ACR for WAR')\
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count for WAR'),0);
Feeders;
#<<< this feeder works because Count and RentalAmount are both leaf level data brought into the cube >>>
['Count']=>['RentalAmount'], ['Avg Contract Rate'];
#<<< these two feeders below DO NOT WORK ... data disappears on zero suppress >>>
[{'Count','RentalAmount'}]=>['ACR for WAR'];
['Count'] => DB(IF(DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,
attrs('Time',!Time,'12MonthsAGO'),'Count')<>0,'Rate','NO FEED'),!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,!Time,'Count for WAR');