Page 1 of 1

Help with a feeder

Posted: Fri May 20, 2022 8:40 pm
by Paul-TM1
Hi All,
I have a rule and having a hard time writng a feeder. Can someone please help? The rule works but on zero suppress, it disappears.

Rule

Code: Select all

['Cost']=N: If (  ATTRS('Versions', !Versions, 'LiveVersion') @= 'Y' &	
	!Accounts @= DB('LaborGroupType', ATTRS('Projects', !Projects, 'PAG')	,	ATTRS('Employees', !Employees, 'LAB_GRP_TYPE') ,'Hours','R','Value') &	
	!Orgs @= ATTRS('Employees', !Employees, 'ORG_ID')	,	
	DB('Labor',!Projects,!Employees,!Months,!Versions,'Planned Cost')		
	+	
	DB('Labor',!Projects,!Employees,!Months,!Versions,'Planned Cost - Overtime'), stet );
Feeder that I have written and not working:

Code: Select all

['Planned Cost'] =>DB( If( ATTRS('Versions', !Versions, 'LiveVersion') @= 'Y',  'SumProjLaborByAccts','') ,!Projects,!Employees, 
	DB('LaborGroupType', ATTRS('Projects', !Projects, 'PAG'),	ATTRS('Employees', !Employees, 'LAB_GRP_TYPE') ,'Hours','R','Value')
 , ATTRS('Employees', !Employees, 'ORG_ID') ,!Months,!Versions,'Cost');

['Planned Cost - Overtime']  =>DB( If( ATTRS('Versions', !Versions, 'LiveVersion') @= 'Y',  'SumProjLaborByAccts',''),!Projects,!Employees, 
	DB('LaborGroupType', ATTRS('Projects', !Projects, 'PAG'),	ATTRS('Employees', !Employees, 'LAB_GRP_TYPE') ,'Hours','R','Value')
 , ATTRS('Employees', !Employees, 'ORG_ID') ,!Months,!Versions,'Cost');
Thanks,
Paul.

Re: Help with a feeder

Posted: Fri May 20, 2022 9:31 pm
by Wim Gielis
Hello Paul,

First, I would create a new measure as the total of 'Planned Cost' and 'Planned Cost - Overtime'.
Reference that new total in the rule (that will be marginally quicker) and in the feeders (you can reduce 2 feeder statements to 1, hence less maintenance and if in the future the total has a 3rd child, no changes to rules nor feeders are needed).

As to the feeders: we need to see the cube names and the dimensions in a TM1 client, to spot typo's or similar errors.
Usually, I replace functions by hardcoded values until the error is gone, then work backwards and add the functions in - testing each step as you progress.

Re: Help with a feeder

Posted: Mon May 23, 2022 5:24 pm
by Paul-TM1
Hi Wim,
Thanks for the advice and I will certainly use it. On further analysis, I found the feeder was from a different cube. I will create a new one rather than use the same thread.

Thanks,
Paul.