Hi, just trying to get some help with rule and feeder statements when sets are used.
With a rule/feeder the right hand side is determined by the elements on the left hand side - the right resolves based on what's on the left? eg,
['2013', 'CompanyB', 'Product1', 'Sales'] = [!Year, 'CompanyA', !Products, !Measures];
['2013', 'CompanyA', 'Product1', 'Sales'] => [!Year, 'CompanyB', !Products, !Measures];
Does this also apply when there are sets of elements on the left? eg
[{'2013', '2014'}, 'CompanyB', 'Product1', {'Sales', 'Cost'}] = [!Year, 'CompanyA', !Products, !Measures];
When there are such sets do the feeders work on the same principle - eg
[{'2013', '2014'}, 'CompanyA', 'Product1', {'Sales', 'Cost'}] => [!Year, 'CompanyB', !Products, !Measures];
or would this cause overfeeding as the right side of the feeder doesn't resolve the individual elements and as such '2013 and '2014' feed all the !Year elements and likewise 'Sales' and 'Cost' feed all the measure elements?
Thanks
Sets in rules
-
- Posts: 3
- Joined: Tue Aug 27, 2013 9:36 am
- OLAP Product: TM1
- Version: 9.5
- Excel Version: 2010
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: Sets in rules
Hello,
Is your example correct:-
If we assume that you have years in your time dimension before 2013 then I believe that
would be set with data from whichever year the rule engine encounters first. The situation would the same for products so '2013' 'Product1' would be set with data for whichever product is encountered first.
If this rule is to make CompanyB Sales = those for CompanyA then would it not in the simplest form look like:-
If you wanted to restrict time then you could do this with and IF statement.
Is your example correct:-
Code: Select all
['2013', 'CompanyB', 'Product1', 'Sales'] = [!Year, 'CompanyA', !Products, !Measures];
['2013', 'CompanyA', 'Product1', 'Sales'] => [!Year, 'CompanyB', !Products, !Measures];
Code: Select all
['2013', 'CompanyB', 'Product1', 'Sales']
If this rule is to make CompanyB Sales = those for CompanyA then would it not in the simplest form look like:-
Code: Select all
['CompanyB'] = ['CompanyA']
['CompanyA'] => ['CompanyB']
-
- Posts: 3
- Joined: Tue Aug 27, 2013 9:36 am
- OLAP Product: TM1
- Version: 9.5
- Excel Version: 2010
Re: Sets in rules
Thanks AmbPin.
Still working on a better understanding of rules and the example I gave is just a simplified rule - but does work with the tests I've done - ie CompanyB = CompanyA for 2013 and the same for 2014.
When you say:
If I use ['CompanyB'] = ['CompanyA'] wouldn't that override consolidations as well? Besides it is only required for a certain products and measures - not a complete replication.
The query is really around using sets and whether they can be written into the feeder statement without causing overfeeding or underfeeding.
Still working on a better understanding of rules and the example I gave is just a simplified rule - but does work with the tests I've done - ie CompanyB = CompanyA for 2013 and the same for 2014.
When you say:
do you mean if I had 2010 in my year dimension then if the rule encounters it first it will return the 2010 data in CompanyB for 2013? I'm not sure this would be the case if the right side of the rule uses what's on the left.set with data from whichever year the rule engine encounters first
If I use ['CompanyB'] = ['CompanyA'] wouldn't that override consolidations as well? Besides it is only required for a certain products and measures - not a complete replication.
The query is really around using sets and whether they can be written into the feeder statement without causing overfeeding or underfeeding.
-
- 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: Sets in rules
No, this does not cause overfeededing. Using sets like you have with the set on the left hand side (which really tells TM1 which area of the cube is affected by the rule) and the bang (!) notation on the right you are just applying the rule to 2013 and 2014, using the corresponding years on the right. The same holds true for the way you wrote the feeder.tm1support wrote:Hi, just trying to get some help with rule and feeder statements when sets are used.
With a rule/feeder the right hand side is determined by the elements on the left hand side - the right resolves based on what's on the left? eg,
['2013', 'CompanyB', 'Product1', 'Sales'] = [!Year, 'CompanyA', !Products, !Measures];
['2013', 'CompanyA', 'Product1', 'Sales'] => [!Year, 'CompanyB', !Products, !Measures];
Does this also apply when there are sets of elements on the left? eg
[{'2013', '2014'}, 'CompanyB', 'Product1', {'Sales', 'Cost'}] = [!Year, 'CompanyA', !Products, !Measures];
When there are such sets do the feeders work on the same principle - eg
[{'2013', '2014'}, 'CompanyA', 'Product1', {'Sales', 'Cost'}] => [!Year, 'CompanyB', !Products, !Measures];
or would this cause overfeeding as the right side of the feeder doesn't resolve the individual elements and as such '2013 and '2014' feed all the !Year elements and likewise 'Sales' and 'Cost' feed all the measure elements?
Thanks
-
- Posts: 3
- Joined: Tue Aug 27, 2013 9:36 am
- OLAP Product: TM1
- Version: 9.5
- Excel Version: 2010
Re: Sets in rules
Much appreciated Tomok. That's cleared it up for me.