Page 1 of 1

Writing Feeder

Posted: Fri Jul 11, 2014 12:18 pm
by deepakjain2020
Hi All,

It's a general question related to feeder.

Does it make sense in writting IF condition as written below?
Is it also coined as conditional feeder?
I think it might be stupid to use STET in feeders, but if anyone has ever tried out please share some knowledge on it.

['Elem1','elem2','elem3','Measure'] => DB('Cube',!Dim1,!Dim2,IF( ATTRS('period', !period, 'elem4') @= 'Actual',stet,!period),'elem3','elem5','elem6','measure');

Regards,
Deepak Jain

Re: Writing Feeder

Posted: Fri Jul 11, 2014 12:32 pm
by declanr
I've always used an empty string instead of STET for conditional feeders. Does your code save and work?

The concept of a conditional feeder however does of course make sense if the requirement is such. Only you know whether your rules and feeders are logical (you need to share the requirement for people to really say whether it is sensible or not.)

Re: Writing Feeder

Posted: Fri Jul 11, 2014 12:53 pm
by deepakjain2020
Hi Declanr,

I have no specific requirement, but was just wondering to understand.

Difference in between below codes

Case1:

['Elem1','elem2','elem3','Measure'] => DB('Cube',!Dim1,!Dim2,IF( ATTRS('period', !period, 'elem4') @= 'Actual',stet,!period),'elem3','elem5','elem6','measure');

Case2:

['Elem1','elem2','elem3','Measure'] => DB(IF( ATTRS('period', !period, 'elem4') @= 'Actual','','Cube')!Dim1,!Dim2,IF( ATTRS('period', !period, 'elem4') @= 'Actual',stet,!period),'elem3','elem5','elem6','measure');

I am aware that Case2 will be called as a conditional feeder. But case1 seems to be somewhat different.
I am not sure which one makes a better sense, if we will be applying in our requirements.

Just to get more info on this kind of thing shared in forum. It may make sense or may not, not sure...

Regards,
Deepak Jain

Re: Writing Feeder

Posted: Fri Jul 11, 2014 1:01 pm
by declanr
Both do the same thing at the end of the day but your second statement would only make sense to have 1 if statement.

Re: Writing Feeder

Posted: Fri Jul 11, 2014 1:15 pm
by deepakjain2020
declanr wrote:Both do the same thing at the end of the day but your second statement would only make sense to have 1 if statement.
Hi Declan,

Thanks for sharing knowledge.
Oops my mistake in a hurry,

Case2: ['Elem1','elem2','elem3','Measure'] => DB(IF( ATTRS('period', !period, 'elem4') @= 'Actual','','Cube')!Dim1,!Dim2,!period,'elem3','elem5','elem6','measure');

We can write feeders as in Case1, is that right?

Regards,
Deepak Jain

Re: Writing Feeder

Posted: Fri Jul 11, 2014 1:22 pm
by declanr
Like I said I've never used STET in the feeder bit you can easily check by putting it in a model.

Re: Writing Feeder

Posted: Fri Jul 11, 2014 1:41 pm
by tomok
STET is a specialized rule function to cancel the application of a rule to a certain area of the cube. Since a feeder statement is technically not a rule I don't know that it is valid to use a STET in a feeder. The only way to know is to try. But why? The recommended way (by IBM no less) to do a conditional feeder is to use an empty string for the cube name. Why even attempt to use STET. Don't you have better things to do?

Re: Writing Feeder

Posted: Fri Jul 11, 2014 1:57 pm
by deepakjain2020
Hi Tomok,

I have seen in previous company where they use to have lot of IF statements and those were based on ATTRS function.
So I just thought of getting understanding from you folks.

I really appreciate your valuable feedbacks.

Regards,
Deepak Jain