Page 1 of 1

Need hele with Rule

Posted: Tue Feb 10, 2026 11:03 pm
by Paul-TM1
Hi,
I need help with a rule.

Code: Select all

['Hours'] =N: if (
	attrs( 'Versions', 'Forecast', 'LiveVersion') @='Y' 
	& !Companies @= attrs ( 'Employees' ,  !Employees, 'EmplGroup' )
	& !PLC @= DB('Labor-ASDF',!Employees,!Months,!Projects,!Versions,'PLC')
	,
	DB('Labor-ASDF',!Employees,!Months,!Projects,!Versions,'Hours')
	,							
	CONTINUE 
);
In the rule, I am getting an error on two lines

Code: Select all

!PLC @= DB('Labor-ASDF',!Employees,!Months,!Projects,!Versions,'PLC')

and

Code: Select all

DB('Labor-ASDF',!Employees,!Months,!Projects,!Versions,'Hours')
On both lines, I get invalid string expression. I have verified and 'PLC' in both cubes is a string and the same measure dimension "Labor Calcs" common in both cubes.
And 'Hours' is a number from the same measure dimension "Labor Calcs" common in both cubes.

Can someone help? stuck on this for more than 2 hours.

Thanks,
Paul.

Re: Need hele with Rule

Posted: Wed Feb 11, 2026 8:40 am
by lotsaram
First the basics: are the dimensions Employees,Months,Projects & Versions all in the cube? Otherwise you will get a invalid string error for any attempt to reference !dimension if the dimension doesn't exist in the cube.

Have you tried reversing the test? Sometimes TM1 just doesn't like string comparison tests with !dimension leading and it just needs to be on the other side of the = e.g.

Code: Select all

DB('Labor-ASDF',!Employees,!Months,!Projects,!Versions,'PLC') @= !PLC
Question: If Versions is part of the cube why is 'Forecast' hardcoded and not using a !Versions reference? This looks odd to me.

Re: Need hele with Rule

Posted: Wed Feb 11, 2026 2:59 pm
by Paul-TM1
Thanks Lotsaram.
Fresh set of eyes fixed the issue. There was one dimension missing in my rule. Your pointing to basics made me check.

Thanks,
Paul.