DB function inside the same cube and other questions
Posted: Tue Jan 27, 2015 8:27 pm
Hi,
I'm pretty new to using the feeders and I'm editing codes left by another developer. I noticed that the developer frequently used the DB function when feeding data inside the same cube. For instance:
Those are sample of code inside the rules of cube "Ventes", so the use of the DB function seems unnecessary. My understanding of the DB function is that it's necessary only when accessing data from another cube. Is there another good reason to use it inside the same cube or this is a bad practice?
While I'm at it, I will ask another newbie question.
I added the following rules to the cube:
My test have shown that both feeders were necessary, the same way it would be if I was doing an addition between 'BB$' and 'BB$ Deb'. Still, I have some doubt about if this is an optimal practice or if there is a better way. In that case, I tested for equality ((['Bkd', 'Réel', 'BB$ Deb'] = 0) since when I tested for "greater than" with the True/False reversed, it didn't work property. My original rule was (with both feeders above):
Last question: Is there an advantage to make an assignment on leaves only ( = N: ) as the result are the same as if I had used a simple assignment ( = ) since TM1 calculate the consolidation anyway. Is there a performance or reliability advantage to use one over the other in such simple case?
Thanks for you support.
I'm pretty new to using the feeders and I'm editing codes left by another developer. I noticed that the developer frequently used the DB function when feeding data inside the same cube. For instance:
Code: Select all
['adj','simulation 1','VN $']=n:if (db('Ventes',!produits,!routes,!rabais,!client,'bkd','simulation 1',!banner_div,!year_week,'VN $ Target')<>0,
db('Ventes',!produits,!routes,!rabais,!client,'bkd','simulation 1',!banner_div,!year_week,'VN $ Target') -
db('Ventes',!produits,!routes,!rabais,!client,'bkd','simulation 1',!banner_div,!year_week,'VN $'),0);
FEEDERS;
['bkd','simulation 1','VN $ Target']=>db('Ventes',!produits,!routes,!rabais,!client,'adj','simulation 1',!banner_div,!year_week,'VN $');
While I'm at it, I will ask another newbie question.
I added the following rules to the cube:
Code: Select all
['Bkd', 'Réel', 'BB$ Calc']= N: IF(['Bkd', 'Réel', 'BB$ Deb'] = 0, ['Bkd', 'Réel', 'BB$'], ['Bkd', 'Réel', 'BB$ Deb']) ;
FEEDERS;
['Bkd', 'Réel', 'BB$']=>['Bkd', 'Réel', 'BB$ Calc'];
['Bkd', 'Réel', 'BB$ Deb']=>['Bkd', 'Réel', 'BB$ Calc'];
Code: Select all
['Bkd', 'Réel', 'BB$ Calc']= N: IF(['Bkd', 'Réel', 'BB$ Deb'] > 0, ['Bkd', 'Réel', 'BB$ Deb'], ['Bkd', 'Réel', 'BB$']) ;
Thanks for you support.