Page 1 of 1

Feeders to calculate Totals

Posted: Tue Sep 30, 2008 8:27 pm
by ssp
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.

Re: Feeders to calculate Totals

Posted: Tue Sep 30, 2008 11:04 pm
by paulsimon
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

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 2:13 am
by ssp
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.

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 5:17 am
by Michel Zijlema
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

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 5:32 am
by ssp
That didn't work either. hmm really puzzling me now.

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 7:07 am
by Michel Zijlema
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

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 7:52 am
by Steve Rowe
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

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 7:59 am
by Renaud MARTIAL
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.

Re: Feeders to calculate Totals

Posted: Wed Oct 01, 2008 11:29 pm
by ssp
Unfortunately, still no luck with this. I tried putting the attribute "prod_cat" on the prod dimension as well.

HMMM.

Re: Feeders to calculate Totals

Posted: Thu Oct 02, 2008 2:44 am
by Gregor Koch
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