Need hele with Rule

Post Reply
Paul-TM1
Regular Participant
Posts: 153
Joined: Tue Jun 13, 2017 3:20 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Need hele with Rule

Post 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.
lotsaram
MVP
Posts: 3709
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Need hele with Rule

Post 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.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Paul-TM1
Regular Participant
Posts: 153
Joined: Tue Jun 13, 2017 3:20 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Need hele with Rule

Post 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.
Post Reply