Next question from novice in TM1
I'm trying to write rule for next situation. I have 2 cubes. Cube A for simplicity with 2 dimension:
1. months (Jan, Feb,..., Dec)
2. measures1 (element1 (sum), element2 (Jan, Feb, ... Dec));
For example
Jan Feb Mar Apr May Jun
element 1 10 20 10 30 40 30
element 2 Jan Jan Jan Apr Apr Apr
Cube B also contains 2 dimension
1. months (Jan, Feb,... Dec)
2. measures2 (element3 (sum))
I want to receive next order of date in Cube B
Jan Feb Mar Apr May Jun
element 1 40 0 0 100 0 0
So you can understand element 2 in Cube A shows month in Cube B where I want to allocate sum from element 1. Unfortunately I can't imagine how I can write necessary rule. Can anybody help?
Help with writing rule
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
- Martin Ryan
- Site Admin
- Posts: 2003
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: Help with writing rule
Am I oversimplifying by surmising that you're trying to copy Q1 to Jan and Q2 to April? If that is all you're doing then...
1) Create consolidations in your month dimension for Q1, Q2, Q3, Q4
2) Create an attribute in the Months dimension called "Quarter". Jan=Q1, Feb=<blank>, ... Apr=Q2, May=<blank>..., Dec=<blank>
3) Create another attribute in Months called "Feed to". Jan=Jan, Feb=Jan, Mar=Jan, Apr=Apr, May=Apr ... Dec=Oct
4) Feeder in source cube is ['Measure'] => DB('DestnCube', attrs('Month', !Month, 'Feed to'), 'Element1');
5) Rule in destn cube is ['Element1'] = N: DB('SourceCube', attrs('Month', !Month, 'Quarter'), 'Element1');
The rule in step five will fail for any month that has left the Quarter attribute blank. Alternatively you could make the target specific i.e. ['Element1', {'Jan', 'Apr', 'Jun', 'Oct'}] = ...
HTH,
Martin
1) Create consolidations in your month dimension for Q1, Q2, Q3, Q4
2) Create an attribute in the Months dimension called "Quarter". Jan=Q1, Feb=<blank>, ... Apr=Q2, May=<blank>..., Dec=<blank>
3) Create another attribute in Months called "Feed to". Jan=Jan, Feb=Jan, Mar=Jan, Apr=Apr, May=Apr ... Dec=Oct
4) Feeder in source cube is ['Measure'] => DB('DestnCube', attrs('Month', !Month, 'Feed to'), 'Element1');
5) Rule in destn cube is ['Element1'] = N: DB('SourceCube', attrs('Month', !Month, 'Quarter'), 'Element1');
The rule in step five will fail for any month that has left the Quarter attribute blank. Alternatively you could make the target specific i.e. ['Element1', {'Jan', 'Apr', 'Jun', 'Oct'}] = ...
HTH,
Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
Re: Help with writing rule
Of course it isn't so easy.
There can be many other variants:
1-st example
Jan Feb Mar Apr May Jun
10 20 30 50 10 30
Feb Feb Feb May May May
or
Jan Feb Mar Apr May Jun
10 20 30 50 10 30
Feb Feb Feb Feb Feb Feb
or
Jan Feb Mar Apr May Jun
0 0 30 50 10 30
May May May May
I found only one appropriate way - create auxiliary Cube where I calculate consolidaions. It looks like for the 1-st example
elements| |Jan Feb Mar Apr May Jun
Jan | |0 | 10 | 0 |0 |0 | 0
Feb | |0 | 20 | 0 |0 |0 | 0
Mar | |0 | 30 | 0 |0 |0 | 0
Apr | |0 | 0 | 0 |0 |50 | 0
May | |0 | 0 | 0 |0 |10 | 0
Jun | |0 | 0 | 0 |0 |30 | 0
Total | |0 | 60| 0 |0 |90 | 0
And I use in rule of the second cube datas from auxiliary cube. It isn't very convinient but noobody has given good advice yet.
And in Cognos Planning this task is solved using one Accumulation link.
There can be many other variants:
1-st example
Jan Feb Mar Apr May Jun
10 20 30 50 10 30
Feb Feb Feb May May May
or
Jan Feb Mar Apr May Jun
10 20 30 50 10 30
Feb Feb Feb Feb Feb Feb
or
Jan Feb Mar Apr May Jun
0 0 30 50 10 30
May May May May
I found only one appropriate way - create auxiliary Cube where I calculate consolidaions. It looks like for the 1-st example
elements| |Jan Feb Mar Apr May Jun
Jan | |0 | 10 | 0 |0 |0 | 0
Feb | |0 | 20 | 0 |0 |0 | 0
Mar | |0 | 30 | 0 |0 |0 | 0
Apr | |0 | 0 | 0 |0 |50 | 0
May | |0 | 0 | 0 |0 |10 | 0
Jun | |0 | 0 | 0 |0 |30 | 0
Total | |0 | 60| 0 |0 |90 | 0
And I use in rule of the second cube datas from auxiliary cube. It isn't very convinient but noobody has given good advice yet.
And in Cognos Planning this task is solved using one Accumulation link.
-
- Community Contributor
- Posts: 132
- Joined: Thu Oct 15, 2009 7:45 pm
- OLAP Product: TM1
- Version: 9.4.1 9.5 9.5.1
- Excel Version: 2003 2007
Re: Help with writing rule
I believe there is a problem with your design.
Cube 1 ( 2 Dimensions)
Dimension 1: Sum, 1, 2, 3, 4, 5 (These number can go on as many as you need just make then all children on Sum)
Dimension 2: Jan, Feb, Mar, Apr...
So your cube for 1st example would look like this:
feb may
Sum 60 90
1 10 50
2 20 10
3 30 30
Then in your second cube, you can just pull
[]=DB('cube 1', 'Sum', !month );
Cube 1 ( 2 Dimensions)
Dimension 1: Sum, 1, 2, 3, 4, 5 (These number can go on as many as you need just make then all children on Sum)
Dimension 2: Jan, Feb, Mar, Apr...
So your cube for 1st example would look like this:
feb may
Sum 60 90
1 10 50
2 20 10
3 30 30
Then in your second cube, you can just pull
[]=DB('cube 1', 'Sum', !month );
Ankur Jain