Page 1 of 1

Can't Figure Out The Feeders

Posted: Tue Jul 21, 2009 3:55 pm
by DNA_DC
Hey again everyone,

I seem to be getting a major headache from trying to figure this out and so I thought I'd reach out to the forum's resident brain trust.

I am trying to create a rule that will look at an attribute and use it as a reference for what value to use as a "target." I have posted the rule and the corresponding feeders below. However, I have a major issue. The value for the "target" shows up at all levels below level 2... and I can't figure out why.

All help would be appreciated.

Code: Select all

SKIPCHECK;

['Target'] = DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, !Requirements Measures);

FEEDERS;

['Target COL'] =>DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, 'Units');

['Target COL'] => DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations,  'Cost');

Re: Can't Figure Out The Feeders

Posted: Tue Jul 21, 2009 6:32 pm
by paulsimon
Hi

I haven't looked at this in detail, but assuming that you only want the Target to appear at the base level, you just need to change your rule to add an N:

Code: Select all

['Target'] = N: DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, !Requirements Measures);
DNA_DC wrote:Hey again everyone,

I seem to be getting a major headache from trying to figure this out and so I thought I'd reach out to the forum's resident brain trust.

I am trying to create a rule that will look at an attribute and use it as a reference for what value to use as a "target." I have posted the rule and the corresponding feeders below. However, I have a major issue. The value for the "target" shows up at all levels below level 2... and I can't figure out why.

All help would be appreciated.

Code: Select all

SKIPCHECK;

['Target'] = DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, !Requirements Measures);

FEEDERS;

['Target COL'] =>DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, 'Units');

['Target COL'] => DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations,  'Cost');

Re: Can't Figure Out The Feeders

Posted: Tue Jul 21, 2009 9:12 pm
by DNA_DC
Well, I want this to be calculated at the base level but be aggregated at all of the levels above level > 0.

Re: Can't Figure Out The Feeders

Posted: Tue Jul 21, 2009 9:22 pm
by Alan Kirk
DNA_DC wrote:Well, I want this to be calculated at the base level but be aggregated at all of the levels above level > 0.
Yes, that's what should happen if you follow Paul's suggestion.

You'd be telling the rule that you want it to apply to the N level elements only. Any consolidations which add the N level values together will then ignore the rule and operate normally; they'll add the values of the N level elements just as if those values had been populated manually.

However you do have to make sure that you have a feeder pointing to ['Target'], otherwise you're likely to get inconsistent behaviour in the values being returned. (Particularly if you have zero suppression on.)

Re: Can't Figure Out The Feeders

Posted: Wed Jul 22, 2009 8:23 am
by paulsimon
Assuming that

Code: Select all

ATTRS('Functions',!Functions,'Target') 
is gives you the Alias for Target, then you could change your Feeder to:

Code: Select all

['Target COL'] =>DB('Requirement', !Cycles, !Versions, !Stages, 'Target', !Fiscal Years, !Functions, !Installations, 'Units');
Regards

Paul Simon

DNA_DC wrote:Hey again everyone,

I seem to be getting a major headache from trying to figure this out and so I thought I'd reach out to the forum's resident brain trust.

I am trying to create a rule that will look at an attribute and use it as a reference for what value to use as a "target." I have posted the rule and the corresponding feeders below. However, I have a major issue. The value for the "target" shows up at all levels below level 2... and I can't figure out why.

All help would be appreciated.

Code: Select all

SKIPCHECK;

['Target'] = DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, !Requirements Measures);

FEEDERS;

['Target COL'] =>DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, 'Units');

['Target COL'] => DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations,  'Cost');

Re: Can't Figure Out The Feeders

Posted: Thu Jul 23, 2009 10:29 am
by par3
I agree,

Drop the ATTRS function in the feeder.

Re: Can't Figure Out The Feeders

Posted: Thu Jul 23, 2009 6:42 pm
by DNA_DC
Well, its not an alias at all... rather an attribute that is actually the used to determine which "Target" to select (i.e. for this Function, the Target Band is X). I am using the Target Band as an attribute of the Function... There is one target band per function but many functions per band... and so I don't think aliases work.

I think I narrowed the problem to rule order... but now I am having an even bigger issue solving the problem:

Code: Select all

SKIPCHECK;

['Cost_hold' ] = N: ['Cost'] ;

['Cost_count' ] = N: IF(['Cost' ] <> 0, 1, 0);

['Cost' ] = C: ['Cost_hold' ] \ ['Cost_count' ];

['Target'] = N: DB('Requirement', !Cycles, !Versions, !Stages, ATTRS('Functions',!Functions,'Target'), !Fiscal Years, !Functions, !Installations, !Requirements);

['Total Amount'] = N: IF( ['Override'] > 0, ['Override'], ['Units'] * ['Cost']);

FEEDERS;


['Cost'] => ['Target'];

['Units'] => ['Target'];

['Override', 'Units', 'Cost'] => ['Total Amount'];



As its written above, the code works perfectly for all of the Measures except cost... it doesn't calculate it at any level above lvl 1...

Re: Can't Figure Out The Feeders

Posted: Fri Jul 24, 2009 8:41 am
by Jeroen Eynikel
It would be helpful if you could post a screenshot showing cost at L0,L1 and L2. Please show a trace calculation/check feeders log as well of the cells. It seems very weird to me that it would calculate correctly at L0 and L1 but not at L2. I kindof suspect it is not calculating properly at L1 either.

Please restart your server first and then check again. Feeders do not get reset untill you restart the dbase.

I.e.

If I write a rule like this

skipcheck;

['value']=['price']*['quantity'];

feeders;

['quantity'] => ['value'];


and then remove the feeder everything will appear to work ok as long as no new data is added or the service is restarted. As soon as you restart the service the lack of feeders will become apparent though.