Page 1 of 1

Feeders: how to feed cube on itself?

Posted: Tue Jan 04, 2011 3:03 pm
by kudzis
This rule takes value from previous month and puts into current month. This rule is written in 'Ilgalaikis turtas' cube.

['Month opening amount'] = N:DB('Ilgalaikis turtas',
AttrS('4 Time', !4 Time, 'prev_month'),!5 versions,'Month closing amount',!3 IT,!2_Tarnybos_Verslai);

What feeders should I write?

Re: Feeders: how to feed cube on itself?

Posted: Tue Jan 04, 2011 3:20 pm
by Steve Vincent
'Month opening amount' relies upon 'Month closing amount', so i'd hazard a guess at something like;
['Month closing amount'] => ['Month opening amount'];

Re: Feeders: how to feed cube on itself?

Posted: Tue Jan 04, 2011 3:23 pm
by tomok
kudzis wrote:What feeders should I write?
Assuming you don't want to just use index numbers of the '4 Time' dimension add a new attribute called 'next_month' and then:

['Month closing amount'] => N:DB('Ilgalaikis turtas',AttrS('4 Time', !4 Time, 'next_month'),!5 versions,'Month opening amount',!3 IT,!2_Tarnybos_Verslai);

Re: Feeders: how to feed cube on itself?

Posted: Tue Jan 04, 2011 3:43 pm
by kudzis
tomok wrote:
kudzis wrote:What feeders should I write?
Assuming you don't want to just use index numbers of the '4 Time' dimension add a new attribute called 'next_month' and then:

['Month closing amount'] => N:DB('Ilgalaikis turtas',AttrS('4 Time', !4 Time, 'next_month'),!5 versions,'Month opening amount',!3 IT,!2_Tarnybos_Verslai);
Thank you tomok, it's working fine. I cannot use index numbers in this solution because it would include quarters, and I want to avoid it. Using 'next_month' attribute is very good solution.

Steve V:
Your solution also works, but in very rare cases produces incorrect results.

Re: Feeders: how to feed cube on itself?

Posted: Wed Jan 05, 2011 1:26 pm
by kudzis
I have some other feeder questions:

1#:
My rule:
['Bendras nusidėvėjimas'] = N:['Nusidėvėjimas'] + ['Investicijų nudėvėjimas'];

FEEDER:
['Nusidėvėjimas', 'Investicijų nudėvėjimas'] => ['Bendras nusidėvėjimas'];

However, when I "Trace feeders" on 'NusidÄ—vÄ—jimas', my trace is empty. Why?

2#:

Rule:
['Įsigijimo vertė'] = N:IF (AttrS('4 Laikotarpiai', !4 Laikotarpiai, 'metai') @= '2011', ['2011 atidarymas'], continue);

FEEDER:
['2011 atidarymas'] => ['Įsigijimo vertė'];

Is this correct? Am I overfeeding here?

Re: Feeders: how to feed cube on itself?

Posted: Wed Jan 05, 2011 2:10 pm
by tomok
kudzis wrote:1#:
My rule:
['Bendras nusidėvėjimas'] = N:['Nusidėvėjimas'] + ['Investicijų nudėvėjimas'];

FEEDER:
['Nusidėvėjimas', 'Investicijų nudėvėjimas'] => ['Bendras nusidėvėjimas'];
According to this rule, 'Bendras...', Nusidev...', and 'Investici...' are all members of the same dimension, correct? If that's the case you can't do this:

['Nusidėvėjimas', 'Investicijų nudėvėjimas']

That syntax is saying those two elements are from two different dimensions. You would have to do:

['NusidÄ—vÄ—jimas'] => ['Bendras nusidÄ—vÄ—jimas'];
['Investicijų nudėvėjimas'] => ['Bendras nusidėvėjimas'];

The better answer is to make 'Bendras nusidÄ—vÄ—jimas' a consolidated node in the dimension and skip the rule. Then no feeder is needed.

Re: Feeders: how to feed cube on itself?

Posted: Wed Jan 05, 2011 3:16 pm
by kudzis
Thank you tomok. I've found out this also works:
[{'Investicijų nudėvėjimas','Nusidėvėjimas'}] => ['Bendras nusidėvėjimas'];

I've branched additional questions as a new topic.