Page 1 of 1

Logical statements in feeder expressions

Posted: Mon Aug 13, 2012 9:55 am
by ioscat
Hello, dear forum!
Is it possible to make logical expression in feeders? I can't make right question to google.
Example: C = A*B, half of A is 0, half of B is 0 so we would like to feed C not from only A or B but from their multiplication.
The same with D = A+B, A-B.

Re: Logical statements in feeder expressions

Posted: Mon Aug 13, 2012 10:00 am
by declanr
They generally get called "Conditional Feeders" or "Variable Feeders"; if you search the forum using those terms you will find a load of topics.

Re: Logical statements in feeder expressions

Posted: Mon Aug 13, 2012 10:41 am
by ioscat
thaks much!

Re: Logical statements in feeder expressions

Posted: Mon Aug 13, 2012 12:20 pm
by tomok
In your case why not just write two feeders:?

A => C;
B => C:

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 12:27 am
by Harvey
If I understand the question correctly, using two feeders would result in overfeeding by a factor of roughly two.

If efficient feeding is the primary concern, there are two possible approaches.

1) Create a measure, Z = A * B; then feed Z => C.
2) Use conditional feeders, [] => DB(IF(A<>0 & B<>0, 'your cube', ''), ... , C)

Obviously that's pseudo-code, but hopefully you get the gist.

Note that both solutions have their own inefficiencies and issues!

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 3:06 pm
by ioscat
thaks everybody for the answers. We are searching mistake that resulted in overfeeding - 2,5GB for this cube. There is feeder like A (#very big consolidation of all dimension except leaf element B) => B (Leaf element). i think that overfeeding is about dimsiz ( myDimension).

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 3:18 pm
by Steve Rowe
Maybe post your actual rules and feeders will help as this theory based approach can be tricky.
For example if your rule is really C = A*B then you only need to feed with one of A or B and should pick the least populted of them.

There's no point trying to write a feeder that says feed with B when A is not populated since when A is not populated C=0 and so C should not be fed.

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 3:33 pm
by ioscat
there is a very big lot of cyrilic letters, it's annoying to retype. there about 3 pages a4 format of code. not now :-(

i'd like to ask several "theoretical" questions before.
C = A x B
A B C
1 1 1
1 0 0
0 1 0
0 0 0
in my example feeding from A column will cause overfeeding by factor 2.

A B C
1 1 1
1 0 0
1 0 0
1 0 0
and here - by factor 4

seems to need yo use conditional feeders

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 3:59 pm
by Steve Rowe
OK understood, you might try and post untranslated if the forum will take it, after a while you can look at the "shape" of the rules and not the actual words..

There are two critical things to understand about feeders.
1.They only take place at the N level in the system, they have no meaning at the C level.
2. If you put a C level in the left hand side of a feeder then this is short hand for a (potentially large) subset of all of the N levels below the consolidation. On the right hand side it means feed all the children of this consolidation.

Point 2 is usually where massive overfeeding comes into play

[ A, 'All Months'] => ['B' , 'All Months'];

is actually 144 feeder statements. Jan feeds all the Ns of All Months, Feb feeds all the Ns of all months etc etc etc.

This is the kind of thing you need to be looking for when checking for overfeeding not sweating the difference on your examples.

HTH

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 4:20 pm
by ioscat
thanks, Steve, idea about months really surprised me a lot.

Is there any way to create feeder from final value of consolidation without making feeder from all leafs?

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 4:56 pm
by Steve Rowe
Well not really no using the same example if you write

[ A, 'All Months'] => ['B'];

Then this is 12 feeders, since you have not specified a month on the right Jan feeds Jan, Feb feeds Feb and so on.

There are two types of overfeeding and only one causes the RAM to bloat, which is overfeeding on the right.

Over feeding on the left looks like this.

[A , 'Big Consolidation']=>[ B, 'N level'];

This will take a long time to evaluate but shouldn't cause a RAM problem since we only ever feed the one cell.

Over feeding on the right you won't be surprised to learn is the opposite.
[ A , 'N Level'] => [B , 'Big Consolidation']

One cell feeds many, causing RAM bloat since cells are fed and maybe rules evaluated where they are not required.
Cheers

Re: Logical statements in feeder expressions

Posted: Tue Aug 14, 2012 6:20 pm
by ioscat
Steve, maybe you should write a book about Tm1?