Page 1 of 1

Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 2:48 pm
by manu0521
Hi Guys,

Need an help with how to write the feeders for the below rule .

I have a accounts recieveable cube which goes to sales cube to grab sales values for the common customer . The values are not being fetched when the balance for the account in AR cube is zero .

Below is my rule.

Code: Select all

['Last 3 Month Sales']=N:if(TIMST(DAYNO(TODAY)-1,'\M \Y')@=!Months ,
		(
		DB('Sales Detail', 'All Distributors', ATTRS('Months', !Months,'PriorMonth1'), !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cos
t Centers', 'All Teams', 'US Reporting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')
		+ DB('Sales Detail', 'All Distributors', ATTRS('Months', !Months,'PriorMonth2'), !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cos
t Centers', 'All Teams', 'US Reporting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')
		+ DB('Sales Detail', 'All Distributors',ATTRS('Months', !Months,'PriorMonth3') , !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cos
t Centers', 'All Teams', 'US Reporting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')),
		(DB('Sales Detail', 'All Distributors', !Months, !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cost Centers', 'All Teams', 'US Re
porting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')
		+DB('Sales Detail', 'All Distributors', ATTRS('Months', !Months,'PriorMonth1'), !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cos
t Centers', 'All Teams', 'US Reporting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')
		+DB('Sales Detail', 'All Distributors',ATTRS('Months', !Months,'PriorMonth2'), !Currency, !Currencies,ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'),'All Regions','All Regions' , 'All Regions','All Customer Types' ,'All Buying Groups', 'All Storage Locations', 'All Cost
 Centers', 'All Teams', 'US Reporting Item Categories', 'US Reporting Billing Types', 'US Reporting Sales Order Types w ZDST', 'Full Revenue')
		));	
I am not sure on what level it has to be fed .

My current feeder for testing is feeding all

[]=>['Last 3 Month Sales'];

But this doesnot work when AR customer has zero balance , even if there is sales corresponding in sales cube.

Any help is appreciated , i am in the process of learning the basics for rules and feeders.

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 2:55 pm
by Emixam
Hi,

I didn't really look at your rules but quickly, if you don't mind about "overfeeding" your model, you should at least do something like that :

Code: Select all

['Full Revenue'] => DB( sCube, ..., ..., 'Last 3 Month Sales');  
But like I said, there will be overfeed .

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 3:27 pm
by manu0521
so does this feeder has to be in AR Cube rules or sales cube rules
['Full Revenue'] => ['Last 3 Month Sales'];

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 5:18 pm
by Emixam
Feeders can be very confusing. I suggest you to read some documentation and also take a look at this previous thread.

https://www.tm1forum.com/viewtopic.php?t=274

In your case, the feeders should be in the Sales Detail cube.

Code: Select all

['Full Revenue'] => DB('AR cube',...,...,...,'Last 3 Month Sales');

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 5:42 pm
by ascheevel
You could consider populating this with a TI process instead of live rule especially if it's only actual sales data you're dealing with, especially if the data for a given month is relatively stable (actuals).

Emixam suggests a good solution if you're not concerned about overfeeding. If it was me and I had to use a rule instead of TI process, I'd be concerned about overfeeding. What I would seek to do instead of feeding from your Sales Detail cube is feed the "Last 3 Month Sales" measure in your AR cube from a smaller cube. You could create a cube with only Customer SolTo Only and Months as dimensions and populate every customer & month with a 1 and then feed your AR cube from that new cube. In your AR cube, the measure "Last 3 Month Sales" for a given customer and month would be fed exactly one time instead of however many rows of sales data exist in your Sales Detail cube for a given customer and month.

feeder statement in new cube with just Customer SoldTo Only and Months as dims:

Code: Select all

[] => DB('AR', ..., ATTRS('Customers SoldTo Only', !Customers SoldTo Only,'SoldToAlias'), !Months, 'Last 3 Month Sales');

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 8:05 pm
by PavoGa
It also appears you are doing a lot of addition in the rule. May consider breaking this gigantic rule into smaller ones by creating a consolidation that has components for each DB() call made. Native TM1 consolidations are much faster than rule-driven addition I believe you'll find.

Re: Feeder Issue Help Needed

Posted: Wed Aug 07, 2019 8:29 pm
by Wim Gielis
Please format your code in the relevant CODE tags for better readability. Thanks.

Re: Feeder Issue Help Needed

Posted: Wed Aug 14, 2019 2:17 am
by manu0521
Thanks for the suggestions went through some code you guys provided.

['Full Revenue'] => DB( sCube, ..., !Month, 'Last 3 Month Sales');

so for above feeder in my rule I have taken values for 3 months and added . like db(month1)+db(month2) etc..

so in my feeder for the month parameter can I just give !month ?

And one last thing in my AR the customer is called as US01-ABC-SoldTo and in my salescube its called as US01-ABC-Billto both are different customer dimension s.

SO while getting sales value from sales I am passing the attribute name of the element which is Billto .

Now in feeders should i again create an attribute for the customer in sales cube and then pass that ?becuse the element in salescube customer is not the same as the one in AR.