RuleCalculation for an specific element

Post Reply
armas
Posts: 16
Joined: Wed Aug 27, 2008 9:38 pm

RuleCalculation for an specific element

Post by armas »

Hello

I have a dimension called Departments.
Then I have a measures dimension called EmployeeMeasures with AvaliableHrs as a C: element composed by PayHrs and StdHrs.

Suppose I have the following department in the Departments dimension and three employees rolling up to it:

1820 - ControlFinance
*John D
*Arnie K
*Dan Lot

Is there a way to write a rule that zeroes AvailableHrs for 1820 - ControlFinance dep only??
User avatar
Martin Ryan
Site Admin
Posts: 1988
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: RuleCalculation for an specific element

Post by Martin Ryan »

Do you want it zeroed at ControlFinance level, or at Employee level? Here's a couple of options for either

Code: Select all

['1820 - Control Finance', 'Available Hours'] = C: 0; (Just does the consolidated level, doesn't affect employees)

['Available hours'] = C:
if(elisanc('Departments', '1820 - Control Finance', !Departments)=1 % !Departments@='1820 - Control Finance', 0, stet); (does both employees and Control Finance consolidation.  Check behaviour of Control Finance parents as it [i]might [/i]not do what you expect.)

[{'John D', 'Arnie K', 'Dan Lot'}, 'Available hours'] = C: 0; (Employees only, doesn't cater for new employees {} is shorthand for writing the same rule for lots of elements in the same dimension)
Note % is the logical "or"
elisanc is element is ancestor
When comparing strings you have to use @= not simply = (you can also use @<> for not equals for strings)

HTH,
Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Post Reply