Page 1 of 1
How to write feeders for this rule?
Posted: Wed Jan 23, 2013 10:54 pm
by macsir
['Actual','Z'] =
IF ( (['X'] - ['Y']) >= 0, 2,
IF ( (['X'] - ['Y']) >= -0.05, 1, -1)
);
I am using this one to feed it but looks like cube is still not fed correctly. The result in cube is right by the way.
['Actual','X']=> ['Z'];
['Actual','X']=> ['Z'];
Re: How to write feeders for this rule?
Posted: Wed Jan 23, 2013 11:00 pm
by declanr
macsir wrote:['Actual','Z'] =
IF ( (['X'] - ['Y']) >= 0, 2,
IF ( (['X'] - ['Y']) >= -0.05, 1, -1)
);
I am using this one to feed it but looks like cube is still not fed correctly. The result in cube is right by the way.
['Actual','X']=> ['Z'];
['Actual','X']=> ['Z'];
I presume the above is a typo and you actually have 2 feeders:
['Actual','X']=>['Z'] and ['Actual','Y']=>['Z']
Your problem will be that if both X and Y are 0:
(0-0)=0 therefore ['Z'] = 2
So neither X or Y will feed Z in that scenario as they are 0. But Z needs to be fed as it has a value from the result, therefore looking at your rule Z will always have a value and therefore Z always needs to be fed.
You need to think of a way to ALWAYS feed Z. Up to you how you do it...
Re: How to write feeders for this rule?
Posted: Wed Jan 23, 2013 11:02 pm
by macsir
thanks for quick reply. your words make sense but how to always feed Z if it is not coming from X or Y.

Re: How to write feeders for this rule?
Posted: Wed Jan 23, 2013 11:30 pm
by Alan Kirk
macsir wrote:thanks for quick reply. your words make sense but how to always feed Z if it is not coming from X or Y.

Nobody can give you an exact answer without knowing a lot more about your rules and cubes, but there are (at least) two things to consider:
(a) If you feed from a consolidation, you're effectively feeding from all of its children. Yes, it can cause overfeeding but unless it's the type of overfeeding that blows your system out it can sometimes be a price worth paying. Or at least one that has to be paid. Your only problem then would be if every element in the consolidation was also zero.
(b) There may be another value in your model that is a key driver; that is, some kind of value where X, Y and Z make no sense unless that value is populated, even though none of them directly depend on it for calculation purposes. Although it's
conventional to feed from one of the arguments that are used directly in the calculation of (in this case) Z, it's not "gun to the head mandatory". If Z only has a valid value when, say, R is populated, then feeding from R is certainly an option. (As would be feeding from "dummy" consolidations of R + X and R+ Y, which would bring us back to the principle above.)
Re: How to write feeders for this rule?
Posted: Wed Jan 23, 2013 11:59 pm
by macsir
Thanks for the hints, Alan. I would have a deep insight to my rules and will come back.
Re: How to write feeders for this rule?
Posted: Thu Jan 24, 2013 1:50 am
by macsir
Hi, All
Problem solved. Those unfed cells are the cells with X =0 and Y =0. So I skip those cells and only apply the rule to X <>0 or Y <> 0.
Thanks all.

Re: How to write feeders for this rule?
Posted: Thu Jan 24, 2013 11:34 am
by ioscat
declanr wrote:macsir wrote:['Actual','Z'] =
IF ( (['X'] - ['Y']) >= 0, 2,
IF ( (['X'] - ['Y']) >= -0.05, 1, -1)
);
I am using this one to feed it but looks like cube is still not fed correctly. The result in cube is right by the way.
['Actual','X']=> ['Z'];
['Actual','X']=> ['Z'];
I presume the above is a typo and you actually have 2 feeders:
['Actual','X']=>['Z'] and ['Actual','Y']=>['Z']
Your problem will be that if both X and Y are 0:
(0-0)=0 therefore ['Z'] = 2
So neither X or Y will feed Z in that scenario as they are 0. But Z needs to be fed as it has a value from the result, therefore looking at your rule Z will always have a value and therefore Z always needs to be fed.
You need to think of a way to ALWAYS feed Z. Up to you how you do it...
Need to add: if your zeroes are already fed somehow they still can feed forward. Fed (even unfed) zeroes can feed.