Feeder Problem with Subtraction und Multiplication

Post Reply
Memo66
Posts: 26
Joined: Thu Nov 13, 2014 8:42 am
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: Excel 2010

Feeder Problem with Subtraction und Multiplication

Post by Memo66 »

Hi everyone,

I habe a Rule where I subtract and multipy severel numbers. My Rule looks like:

It's all in one Cube (Cube1)

['dim1','dim2','dim3','dim4','dim5',dim6']=N:
DB('Cube1','dim1',!dim2,'dim3',!dim4,!dim5,'dim6','dim7','dim8',ELPAR('dim9',!dim9,index),'dim10')-(DB('Cube1', 'dim1', !dim2, 'dim3',DB('Cube2', 'Dim', 'Dim'),'dim5', !dim6, !dim7, !dim8, ELPAR('dim9',!dim9,index), 'dim10') *DB('Cube1','dim1',!dim2,'dim3',!dim4,!dim5,'dim6','dim7','dim8','dim9','dim10'))

I tried different Feeders but faild.

Does anyone has perhaps an idea oder suggestion?

Memo
ellissj3
Posts: 54
Joined: Tue Jun 15, 2010 1:43 pm
OLAP Product: Cognos TM1
Version: 9.0 - 10.2
Excel Version: 2010

Re: Feeder Problem with Subtraction und Multiplication

Post by ellissj3 »

Based on the calculation, I anticipate you would need to feed from 2 of the 3 terms:

I evaluated your rule as essentially A-(B*C)

['dim1','dim2','dim3','dim4','dim5',dim6']=N:
DB('Cube1','dim1',!dim2,'dim3',!dim4,!dim5,'dim6','dim7','dim8',ELPAR('dim9',!dim9,index),'dim10')-(DB('Cube1', 'dim1', !dim2, 'dim3',DB('Cube2', 'Dim', 'Dim'),'dim5', !dim6, !dim7, !dim8, ELPAR('dim9',!dim9,index), 'dim10') *DB('Cube1','dim1',!dim2,'dim3',!dim4,!dim5,'dim6','dim7','dim8','dim9','dim10'))
Feed Target from A and B or C.

With my recommendation above, there are others on this forum that would know how to better help you. I suggest you examine the forum guidelines for posting a request. It's difficult to provide assistance to you without more information.
Memo66
Posts: 26
Joined: Thu Nov 13, 2014 8:42 am
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: Excel 2010

Re: Feeder Problem with Subtraction und Multiplication

Post by Memo66 »

Hi,

sorry for the inconvenience, i'll take a look to the guidelines :)

I've read a lot about feeders and everywhere are examples like

['A*B']=n:['A']*['B'];
FEEDERS;
['A']=>['A*B'];

But i could not implement it to my problem.

Is ist possible to give me a example with the syntax for my problem. That would be great.
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: Feeder Problem with Subtraction und Multiplication

Post by TrevorGoss »

Memo,

when you have a multiplication or division based rule, you only need to feed the area definition with the first part of the calculation.

For example:

Code: Select all

  
['C'] =N: (A * B); 
FEEDERS;
['C'] => (A);
  
A is the actual source of the calculation, b is just a number that calculates via the source. There are times when you would times a value from a source by 1000, for example, and there would be no point in feeding an area definiton with 1000.

For addition or subtraction you feed the area definition with both.

For example:

Code: Select all

['C'] =N: ('A + B');
FEEDERS;
['A']=> ['B'];
['A'] => ['C'];
With my recommendation above, there are others on this forum that would know how to better help you. I suggest you examine the forum guidelines for posting a request. It's difficult to provide assistance to you without more information.
Agreed, with more information, I will be able to give you a helping hand. But my demonstration of how feeders work will give you a start.

Thanks.
User avatar
Michel Zijlema
Site Admin
Posts: 713
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: Feeder Problem with Subtraction und Multiplication

Post by Michel Zijlema »

TrevorGoss wrote:when you have a multiplication or division based rule, you only need to feed the area definition with the first part of the calculation.
I agree with you that you only need to feed from one of the calculation component areas, but this can either be A or B (so not necessarily the first part), where the area that best represents the distribution of the resulting area C should be chosen as the feeding area.
F.i. in a simple revenue calculation you can write the rule either as ['revenue'] = N: ['units sold'] * ['price']; or as ['revenue'] = N: ['price'] * ['units sold']; - in both cases ['units sold'] will typically be the most appropriate area to feed from.

Michel
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Feeder Problem with Subtraction und Multiplication

Post by rmackenzie »

TrevorGoss wrote:

Code: Select all

  
['C'] =N: (A * B); 
FEEDERS;
['C'] => (A);
  
This should be:

Code: Select all

SKIPCHECK;
['C'] = N: ( ['A'] * ['B'] );
FEEDERS;
['A'] => ['C'];
['B'] => ['C'];
Per Michel's post, you can choose just one of A or B if it might be 0 at some point e.g. sales volume or number of customers, or something. I think you missed a typo in your code because you have C feeding A, when A should feed C.
TrevorGoss wrote: For example:

Code: Select all

['C'] =N: ('A + B');
FEEDERS;
['A']=> ['B'];
['A'] => ['C'];
This should be written:

Code: Select all

SKIPCHECK;
['C'] = N: ( ['A'] + ['B'] );
FEEDERS;
['A'] => ['C'];
['B'] => ['C'];
I think you missed a typo in your code because you have A feeding B and C, when both A and B should feed C.
Robin Mackenzie
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: Feeder Problem with Subtraction und Multiplication

Post by TrevorGoss »

This should be:

Code: Select all
SKIPCHECK;
['C'] = N: ( ['A'] * ['B'] );
FEEDERS;
['A'] => ['C'];
['B'] => ['C'];
Indeed, it was just psuedo coding to illustrate the point.

This should be written:

Code: Select all
SKIPCHECK;
['C'] = N: ( ['A'] + ['B'] );
FEEDERS;
['A'] => ['C'];
['B'] => ['C'];

I think you missed a typo in your code because you have A feeding B and C, when both A and B should feed C.
Thanks, I missed that one. My overall point still stands, during multiplication and division, you only feed it with one side of the calculation. The number that is performing the division or multiplication, does not need to be declared as an area definition in a feeder.
Post Reply