Page 1 of 1

Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 4:27 am
by StevieBenStevie
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');

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 12:35 pm
by jim wood

Code: Select all

['Count']=>['ACR for WAR'],['Avg Contract Rate'],['Current WAR'],
DB('Rate',!Attachments,!Billed_Type,!Cycle_Bill,!Major_Group,!Equipment,!Location,attrs('Time',!Time,'12MonthsForward'),'Count For War'),
I can't see a rule for RentalAmount so not sure why you're feeding it. As you can above in your going 12 onths back with your rule so you need to go 12 months forward with your feeder. If you don't have the forward attribute 12MonthsForward you'll need to create it.

I hope that helps,

Jim.

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 2:53 pm
by StevieBenStevie
Thanks Jim. Yes Rentalamount comes in via TI and does not need feeding. Not sure why I thought it should be fed. One of those things where you're too close so you quit seeing things. I will create a 12MonthsForward attribute and give your feeder a try.

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 3:00 pm
by jim wood
Let us know how you get on.

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 4:47 pm
by StevieBenStevie
Added a 12MonthsAhead attribute but still no luck... I checked to make sure and 201304's 12 MonthsAhead is working. See attached.

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 6:47 pm
by jim wood
Steve,

The rules you above, is that the complete rule file? Also your attachment didn't come through :D

Jim.

Re: Refuses to be fed...hunger strike?

Posted: Wed May 14, 2014 7:37 pm
by StevieBenStevie
Yes. Pretty much. I cut out some extraneous stuff but the meat of the problem is shown. For some reason I am not able to upload anything here. shoot me something at stbrw1 AT gmailand I will send it to you that way.
thanks,
Steve