Feeder Issue Help Needed

Post Reply
manu0521
Posts: 58
Joined: Wed Nov 26, 2014 8:32 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2010

Feeder Issue Help Needed

Post by manu0521 » Wed Aug 07, 2019 2:48 pm

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.

Emixam
Posts: 40
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: TM1 10.2
Excel Version: 2016

Re: Feeder Issue Help Needed

Post by Emixam » Wed Aug 07, 2019 2:55 pm

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 .
Last edited by Emixam on Fri Aug 09, 2019 1:20 am, edited 1 time in total.

manu0521
Posts: 58
Joined: Wed Nov 26, 2014 8:32 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2010

Re: Feeder Issue Help Needed

Post by manu0521 » Wed Aug 07, 2019 3:27 pm

so does this feeder has to be in AR Cube rules or sales cube rules
['Full Revenue'] => ['Last 3 Month Sales'];

Emixam
Posts: 40
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: TM1 10.2
Excel Version: 2016

Re: Feeder Issue Help Needed

Post by Emixam » Wed Aug 07, 2019 5:18 pm

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');
Last edited by Emixam on Wed Aug 07, 2019 6:12 pm, edited 1 time in total.

ascheevel
Posts: 90
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: 11.2
Excel Version: 2016

Re: Feeder Issue Help Needed

Post by ascheevel » Wed Aug 07, 2019 5:42 pm

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');

User avatar
PavoGa
Community Contributor
Posts: 381
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.05
Excel Version: 2013 PAW
Location: Cleveland, Tennessee

Re: Feeder Issue Help Needed

Post by PavoGa » Wed Aug 07, 2019 8:05 pm

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.
Ty
Cleveland, TN

Wim Gielis
MVP
Posts: 2277
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: Feeder Issue Help Needed

Post by Wim Gielis » Wed Aug 07, 2019 8:29 pm

Please format your code in the relevant CODE tags for better readability. Thanks.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

manu0521
Posts: 58
Joined: Wed Nov 26, 2014 8:32 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2010

Re: Feeder Issue Help Needed

Post by manu0521 » Wed Aug 14, 2019 2:17 am

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.

Post Reply