Feeders to calculate Totals
Feeders to calculate Totals
Attached is a screenshot in word of the feeder I'm trying to write such that the value at intersection
['total cust - prod', 'Quantity'] of 8334 is fed into the target cube at intersection ['Total Products', 'Total Cust'].
The Rule in the target cube is:
SKIPCHECK;
['Quantity']=N:
DB('Product Cust Hier', ATTRS('Customer2', !Customer2, 'CustNo') | ' - ' | ATTRS('Product Categories', !Product Categories, 'Prod_Cat'), 'quantity');
where I'm using an attribute together with the consolidation from the source cube of '1 - 1 - Beverages' or '2 - 1 - Beverages' to bring across totals. The first part of the string here, '1' refers to the customer, where the latter, '1 - Beverages' refers to the product and these are attributes in target cubes' dimensions, "Customer2" & "Product Categories" respectively.
Now, the rule works correctly at the lower leaf levels but I think my feeder statement is incorrect for it not to be populating the intersection ['Total Products', 'Total Cust'] in the target cube.
The feeder in the source cube is:
FEEDERS;
['Total Cust - Prod', 'Quantity']=>DB('ProdCust', subst(!cust - prod, 1, 1), subst(!cust - prod, 5, long(!cust - prod)), 'quantity');
The order of dimensions specified in the feeder and skipcheck statements are correct, rule compiles, however no totals are evaluating.
Help would be much appreciated.
['total cust - prod', 'Quantity'] of 8334 is fed into the target cube at intersection ['Total Products', 'Total Cust'].
The Rule in the target cube is:
SKIPCHECK;
['Quantity']=N:
DB('Product Cust Hier', ATTRS('Customer2', !Customer2, 'CustNo') | ' - ' | ATTRS('Product Categories', !Product Categories, 'Prod_Cat'), 'quantity');
where I'm using an attribute together with the consolidation from the source cube of '1 - 1 - Beverages' or '2 - 1 - Beverages' to bring across totals. The first part of the string here, '1' refers to the customer, where the latter, '1 - Beverages' refers to the product and these are attributes in target cubes' dimensions, "Customer2" & "Product Categories" respectively.
Now, the rule works correctly at the lower leaf levels but I think my feeder statement is incorrect for it not to be populating the intersection ['Total Products', 'Total Cust'] in the target cube.
The feeder in the source cube is:
FEEDERS;
['Total Cust - Prod', 'Quantity']=>DB('ProdCust', subst(!cust - prod, 1, 1), subst(!cust - prod, 5, long(!cust - prod)), 'quantity');
The order of dimensions specified in the feeder and skipcheck statements are correct, rule compiles, however no totals are evaluating.
Help would be much appreciated.
- Attachments
-
- Rules feeders.doc
- (88.5 KiB) Downloaded 523 times
- paulsimon
- MVP
- Posts: 808
- Joined: Sat Sep 03, 2011 11:10 pm
- OLAP Product: TM1
- Version: PA 2.0.5
- Excel Version: 2016
- Contact:
Re: Feeders to calculate Totals
ssp
Hi - I can't see what is immediately wrong with your feeder. Personally I would try to avoid dimension names that start with numbers and have spaces. It is possible that TM1 is getting confused by eg !cust - prod in to thinking that you have a dimension called cust and you want to subtract prod from it.
My first suggestion would be to use the Trace Feeders and Check Feeders options on the view to see if it is being fed. Right Click on the View on the consolidated cell in the target cube and select Check Feeders to see if it is being fed. If it is, then use Trace Calculation to check for a rule problem. If it isn't being fed then Right click on a View in Source Cube on the cell that the value is being fed from, and select Trace Feeders. This will show you where the feeder goes.
Regards
Paul Simon
Hi - I can't see what is immediately wrong with your feeder. Personally I would try to avoid dimension names that start with numbers and have spaces. It is possible that TM1 is getting confused by eg !cust - prod in to thinking that you have a dimension called cust and you want to subtract prod from it.
My first suggestion would be to use the Trace Feeders and Check Feeders options on the view to see if it is being fed. Right Click on the View on the consolidated cell in the target cube and select Check Feeders to see if it is being fed. If it is, then use Trace Calculation to check for a rule problem. If it isn't being fed then Right click on a View in Source Cube on the cell that the value is being fed from, and select Trace Feeders. This will show you where the feeder goes.
Regards
Paul Simon
Re: Feeders to calculate Totals
The trace feeders option is greyed out. I don't think the dimension names are causing the problem. I tried changing the names and still the problem exists.
- Michel Zijlema
- Site Admin
- Posts: 712
- 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: Feeders to calculate Totals
Hi ssp,
I think the subst references in your feeder are the problem - I think they will always refer to the !prod - cust in the feeder area definition ('Total Cust - Prod').
Maybe the following feeder will work?
['Quantity']=>DB('ProdCust', subst(ElpPar('cust - prod', !cust - prod, 1), 1, 1), subst(ElpPar('cust - prod', !cust - prod, 1), 5, long(!cust - prod)), 'quantity');
Michel
I think the subst references in your feeder are the problem - I think they will always refer to the !prod - cust in the feeder area definition ('Total Cust - Prod').
Maybe the following feeder will work?
['Quantity']=>DB('ProdCust', subst(ElpPar('cust - prod', !cust - prod, 1), 1, 1), subst(ElpPar('cust - prod', !cust - prod, 1), 5, long(!cust - prod)), 'quantity');
Michel
Re: Feeders to calculate Totals
That didn't work either. hmm really puzzling me now.
- Michel Zijlema
- Site Admin
- Posts: 712
- 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: Feeders to calculate Totals
Hi ssp,
Are the element names shown the 'bare' element names or are these aliases? If aliases, could you rewrite the feeder so that it directly refers to the element names?
I've seen problems before where rules were not working when refering to aliases.
Michel
Are the element names shown the 'bare' element names or are these aliases? If aliases, could you rewrite the feeder so that it directly refers to the element names?
I've seen problems before where rules were not working when refering to aliases.
Michel
- Steve Rowe
- Site Admin
- Posts: 2455
- Joined: Wed May 14, 2008 4:25 pm
- OLAP Product: TM1
- Version: TM1 v6,v7,v8,v9,v10,v11+PAW
- Excel Version: Nearly all of them
Re: Feeders to calculate Totals
This is I think a classic example of feeders only executing at the N level in the cube.
When you put ['Total Cust - Prod', 'Quantity'], you are saying all the N levels below it, so the feeders are executing at the Lassi or Coke level of the cube.
This means that your use of subst to map from product to product category is failing. You either need to use elpar to look at the parent or perhaps put a product category attribute against each product.
In a rush so can't go into more detail but HTH.
Cheers
When you put ['Total Cust - Prod', 'Quantity'], you are saying all the N levels below it, so the feeders are executing at the Lassi or Coke level of the cube.
This means that your use of subst to map from product to product category is failing. You either need to use elpar to look at the parent or perhaps put a product category attribute against each product.
In a rush so can't go into more detail but HTH.
Cheers
Technical Director
www.infocat.co.uk
www.infocat.co.uk
- Renaud MARTIAL
- Posts: 25
- Joined: Thu May 15, 2008 10:18 am
- Location: Paris, France
Re: Feeders to calculate Totals
Hello,
shouldn't the target rule be
SKIPCHECK;
['Quantity']=DB('Product Cust Hier', ATTRS('Customer2', !Customer2, 'CustNo') | ' - ' | ATTRS('Product Categories', !Product Categories, 'Prod_Cat'), 'quantity');
without the 'N:' qualifier, so that consolidated value is also transfered ?
Renaud.
shouldn't the target rule be
SKIPCHECK;
['Quantity']=DB('Product Cust Hier', ATTRS('Customer2', !Customer2, 'CustNo') | ' - ' | ATTRS('Product Categories', !Product Categories, 'Prod_Cat'), 'quantity');
without the 'N:' qualifier, so that consolidated value is also transfered ?
Renaud.
Re: Feeders to calculate Totals
Unfortunately, still no luck with this. I tried putting the attribute "prod_cat" on the prod dimension as well.
HMMM.
HMMM.
-
- MVP
- Posts: 263
- Joined: Fri Jun 27, 2008 12:15 am
- OLAP Product: Cognos TM1, CX
- Version: 9.0 and up
- Excel Version: 2007 and up
Re: Feeders to calculate Totals
Hi ssp
just adding a bit to Michel's solution maybe try
['Quantity']=>
DB('ProdCust',subst(ELPAR('cust - prod', !cust - prod, 1), 1, 1),subst(ELPAR('cust - prod', !cust - prod, 1), 5, long(ELPAR('cust - prod', !cust - prod, 1))),'Quantity');
Previous code couldn't work because
a.) ElpPar is no function
b.) The second SUBST used the length of the N-Element and not the Parent.
Note that this will only work reliably if eg '1-1-Beverages' always stays the first parent of 'Lassi'
Cheers
Gregor
just adding a bit to Michel's solution maybe try
['Quantity']=>
DB('ProdCust',subst(ELPAR('cust - prod', !cust - prod, 1), 1, 1),subst(ELPAR('cust - prod', !cust - prod, 1), 5, long(ELPAR('cust - prod', !cust - prod, 1))),'Quantity');
Previous code couldn't work because
a.) ElpPar is no function
b.) The second SUBST used the length of the N-Element and not the Parent.
Note that this will only work reliably if eg '1-1-Beverages' always stays the first parent of 'Lassi'
Cheers
Gregor