How to write this Rules?
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
How to write this Rules?
Hi all,
I need your help to modify the Rules in our TM1 system, it is under feeders:
['dim1_elem1', 'dim2_elem1','dim3_elem1', 'final', {'PR01-1601','PR01-1602','PR01-1603','PR01-1604','PR01-1605','PR01-1606'}, '03', {'FC1','FC2','FC3', 'FC4','FC5', 'FC6', 'FC7', 'FC8','FC9', 'FC10', 'FC11', 'FC12'}] => ['dim1_elem2','12_YTD'];
In the Rule above, '03' is the Months dimension. Now we want to change the Rule to add '02' in Months dimension. And if there is number in '02', feed it further, otherwise feed the number in '03'.
Could you please guide me how to write such Rule?
Thanks a lot!
LP_user
I need your help to modify the Rules in our TM1 system, it is under feeders:
['dim1_elem1', 'dim2_elem1','dim3_elem1', 'final', {'PR01-1601','PR01-1602','PR01-1603','PR01-1604','PR01-1605','PR01-1606'}, '03', {'FC1','FC2','FC3', 'FC4','FC5', 'FC6', 'FC7', 'FC8','FC9', 'FC10', 'FC11', 'FC12'}] => ['dim1_elem2','12_YTD'];
In the Rule above, '03' is the Months dimension. Now we want to change the Rule to add '02' in Months dimension. And if there is number in '02', feed it further, otherwise feed the number in '03'.
Could you please guide me how to write such Rule?
Thanks a lot!
LP_user
- ioscat
- Regular Participant
- Posts: 209
- Joined: Tue Jul 10, 2012 8:26 am
- OLAP Product: Contributor
- Version: 9.5.2 10.1.1 10.2
- Excel Version: 07+10+13
- Contact:
Re: How to write this Rules?
if you write you will feed from both '02' and '03'. So if there is a number or fed value in '02' it will feed further. The same for '03'. If you need to feed month from previous month, use ATTRS.
Code: Select all
[..., {'02','03'}, ...]=>DB(...)
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
Re: How to write this Rules?
Hi ioscat,
Thanks for your reply.
I only want to feed the number from one month. If there is a number in previous month, then feed it. Otherwise, feed the current month. So there should be one condition to decide which month to feed.
Could you please tell me how to write such condition?
Best regards,
LP_work
Thanks for your reply.
I only want to feed the number from one month. If there is a number in previous month, then feed it. Otherwise, feed the current month. So there should be one condition to decide which month to feed.
Could you please tell me how to write such condition?
Best regards,
LP_work
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: How to write this Rules?
Why would you care? This is a meaningless condition. Feeding from both will not result in any additional memory being used than would writing some sort of conditional feeder that looks at values and feeds from the only one that has a value. The feeders feature already does this for you and in the scenario where they BOTH have a value, feeding from both makes no difference. Once a byte has been used to mark an intersection, any additional feeding on that intersection does not increase memory consumption.LP_user wrote:If there is a number in previous month, then feed it. Otherwise, feed the current month. So there should be one condition to decide which month to feed.
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
Re: How to write this Rules?
Hi tomok,
Thanks for your reply. Do you mean if I write the feeder as:
[..., {'02','03'}, ...]=>DB(...)
It will feed one of these two month, which has the number. And if the both month has numbers (the two numbers might be different), feeder will choose the number in the first month. Is it correct?
If the feeding mechanism works in this way, it is perfect for me. I will try it.
Best regards,
LP_user
Thanks for your reply. Do you mean if I write the feeder as:
[..., {'02','03'}, ...]=>DB(...)
It will feed one of these two month, which has the number. And if the both month has numbers (the two numbers might be different), feeder will choose the number in the first month. Is it correct?
If the feeding mechanism works in this way, it is perfect for me. I will try it.
Best regards,
LP_user
-
- MVP
- Posts: 1828
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: How to write this Rules?
No, what is on the left hand side will feed the same element on the right hand side, unless a different element for the same dimension is specified on the right hand side.LP_user wrote:Do you mean if I write the feeder as:
[..., {'02','03'}, ...]=>DB(...)
It will feed one of these two month, which has the number. And if the both month has numbers (the two numbers might be different), feeder will choose the number in the first month. Is it correct?
E.g.
Code: Select all
['A','01'] => ['B']
The curly brackets specify that it feeds for both so:
Code: Select all
['A',{'01','02'}] => ['B']
Code: Select all
['A','01'] => ['B','01']
Code: Select all
['A','02'] => ['B','02']
Declan Rodger
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
Re: How to write this Rules?
Hi declanr,
Thanks for your detailed explanation. It sounds that
[..., {'02','03'}, ...]=>DB(...)
won't meet my requirement.
May I use the workaround that not using feeders, instead, using normal Rules to solve my problem:
DB(...) = N: if (DB[..., {'02'}, ...]@<>0,DB[..., {'02'}, ...],DB[..., {'03'}, ...]);
Would this workaround work for me?
Best,
LP_user
Thanks for your detailed explanation. It sounds that
[..., {'02','03'}, ...]=>DB(...)
won't meet my requirement.
May I use the workaround that not using feeders, instead, using normal Rules to solve my problem:
DB(...) = N: if (DB[..., {'02'}, ...]@<>0,DB[..., {'02'}, ...],DB[..., {'03'}, ...]);
Would this workaround work for me?
Best,
LP_user
-
- MVP
- Posts: 1828
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: How to write this Rules?
Do you mean that you didn't have a rule statement in place before and just tried populating the numbers with a feeder?LP_user wrote:May I use the workaround that not using feeders, instead, using normal Rules to solve my problem:
DB(...) = N: if (DB[..., {'02'}, ...]@<>0,DB[..., {'02'}, ...],DB[..., {'03'}, ...]);
Would this workaround work for me?
Best,
LP_user
If so it is only a rule statement that populates numbers, feeders work in conjunction with rule statements (when skipcheck is enabled) but will do absolutely nothing if there isn't a rule statement on the target cell/s.
Declan Rodger
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
Re: How to write this Rules?
Hi Declan,
Sorry, I didn't describe the complete situation. There is a rule for this issue, following the feeder.
Rule:
['B'] = N:DB('A',AttrS(..,'Month'));
Feeder:
['A','01'] => ['B'];
['A','02'] => ['B'];
...
Now we want to change the Rule/Feeder, that with the condition that if previous month has the number, then feed to ['B'], otherwise, feed the current month to ['B'].
How should I change the Rule/Feeder to fulfill the task?
Thanks again for your nice help.
Best,
LP_user
Sorry, I didn't describe the complete situation. There is a rule for this issue, following the feeder.
Rule:
['B'] = N:DB('A',AttrS(..,'Month'));
Feeder:
['A','01'] => ['B'];
['A','02'] => ['B'];
...
Now we want to change the Rule/Feeder, that with the condition that if previous month has the number, then feed to ['B'], otherwise, feed the current month to ['B'].
How should I change the Rule/Feeder to fulfill the task?
Thanks again for your nice help.
Best,
LP_user
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: How to write this Rules?
Add an attribute to the Month dimension called Next_Month and then:
FEEDERS;
['A']=>['B'];
['A']=>DB(Cube,!Dim1,!Dim2,Dimx,'B',ATTRS('Month',!Month,'Next_Month');
FEEDERS;
['A']=>['B'];
['A']=>DB(Cube,!Dim1,!Dim2,Dimx,'B',ATTRS('Month',!Month,'Next_Month');
-
- Posts: 28
- Joined: Mon Feb 04, 2013 5:10 pm
- OLAP Product: Cognos TM1
- Version: 9.5.1
- Excel Version: 2007
Re: How to write this Rules?
Hi Tomok,
Thanks for your hints. But I don't understand the logic in your code very well. Your feeder will do:
Feed current month of ['A'] to current month of ['B']
Then feed the current month of ['A'] to next month of ['B'].
['A','01'] => ['B','01'];
['A','01'] => ['B','02'];
['A','02'] => ['B','02'];
['A','02'] => ['B','03'];
['A','03'] => ['B','03'];
['A','03'] => ['B','04'];
...
The same month for ['B'] are feeded twice, the first time is the previous month of ['A'], the second time is the current month of ['A']. So at last, ['B'] will keep the number of the current month of ['A'].
Or do you mean, if there is no number in current month of ['A'], then
['A']=>DB(Cube,!Dim1,!Dim2,Dimx,'B',ATTRS('Month',!Month,'Next_Month');
won't work. So ['B'] will keep the number of the previous month of ['A']. Is it correct?
But if there are numbers in both previous month and current month of ['A'], ['B'] will keep the number of the current month of ['A']. It is not what I want.
Do I understand it in the right way?
But my requirement is that feed once from ['A'] to ['B']. If the previous month of ['A'] has number, then feed to ['B'], otherwise feed the current month of ['A'] to ['B']. So previous month of ['A'] is preffered to feed to ['B'].
Best regards,
LP_user
Thanks for your hints. But I don't understand the logic in your code very well. Your feeder will do:
Feed current month of ['A'] to current month of ['B']
Then feed the current month of ['A'] to next month of ['B'].
['A','01'] => ['B','01'];
['A','01'] => ['B','02'];
['A','02'] => ['B','02'];
['A','02'] => ['B','03'];
['A','03'] => ['B','03'];
['A','03'] => ['B','04'];
...
The same month for ['B'] are feeded twice, the first time is the previous month of ['A'], the second time is the current month of ['A']. So at last, ['B'] will keep the number of the current month of ['A'].
Or do you mean, if there is no number in current month of ['A'], then
['A']=>DB(Cube,!Dim1,!Dim2,Dimx,'B',ATTRS('Month',!Month,'Next_Month');
won't work. So ['B'] will keep the number of the previous month of ['A']. Is it correct?
But if there are numbers in both previous month and current month of ['A'], ['B'] will keep the number of the current month of ['A']. It is not what I want.
Do I understand it in the right way?
But my requirement is that feed once from ['A'] to ['B']. If the previous month of ['A'] has number, then feed to ['B'], otherwise feed the current month of ['A'] to ['B']. So previous month of ['A'] is preffered to feed to ['B'].
Best regards,
LP_user
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: How to write this Rules?
Do you even understand what a feeder is? A feeder is simply a process where TM1 puts a 1 byte marker in a cell to indicate that the intersection is not empty so that when a consolidation is performed it won't be skipped by the sparse consolidation algorithm. Feeding an intersection multiple times will not change the 1 byte marker so my statement is the easiest way to do it.LP_user wrote:But my requirement is that feed once from ['A'] to ['B']. If the previous month of ['A'] has number, then feed to ['B'], otherwise feed the current month of ['A'] to ['B']. So previous month of ['A'] is preffered to feed to ['B'].
Writing a rule to make a cell equal something else is not a feeder. This statement:
Code: Select all
['A'] = ['B']
This statement:
Code: Select all
['B'=>['A']
This is all I have to say on this topic. If you don't understand I suggest you read the TM1 Rules Guide as it is apparent you have not yet done so. Until you fully understand what a feeder is intended to do you will not "get it".