Rules giving inappropriate results.

Post Reply
ravi.ahuja21
Posts: 33
Joined: Tue Aug 30, 2011 8:34 am
OLAP Product: TM1
Version: 9.5
Excel Version: 10.0

Rules giving inappropriate results.

Post by ravi.ahuja21 »

Hi friends,

I have an HR Cube having the following dimension
Function
Facility
Department
Nature
Employee
Scenario
Year
Months
Employee Measures.

I am trying to get data from a Employee master cube having dimensions
Facility
Department
Nature
Employee
Scenario
Year
Months
Employee Master Measures.

I am also trying to get a value from a different cube which is a working day lookup cube, which stores the no of working day in a month.
Year
Months
Working Day Measures(Working Day(n),Holidays(n))

My problem is I am getting results from the Employee master cube if i write 'only' this part of code in my rules.

Code: Select all

# get Base rate
#['Budgeted','Base Rate']=N:DB('Employee Master',!Facility,!Department,!Central Nature,!Year,!Months,'HR',!Employee,'Base Rate');

# get vacation hours.
['Budgeted','Vacation Hours']=N:DB('Employee Master',!Facility,!Department,!Central Nature,!Year,!Months,'HR',!Employee,'Accrued Vacation Hours');

# get no of employees.
['Budgeted','No of Shift or Employee']=N:if(ATTRS('Employee',!Employee,'Employee Name')@<>'TEMP ',DB('Employee Master',!Facility,!Department,!Central Nature,!Year,!Months,'HR',!Employee,'No of Employees'),STET);	

But as soon as i include this part in the rules the values for (base rate, vacation hours, no of employees) which i am taking from the Employee master cube goes to zero
I get values for only the working days, rest of the values turns zero.

Code: Select all

#get the working days.
['Budgeted','Working Days']=	N:DB('Working Day',!Year,!Months,'Total Working Day');
['Budgeted','Holidays']=N:DB('Working Day',!Year,!Months,'Total Holidays');	

I am not able to figure out what is going wrong, I have also tried unloading the cube but nothing changes.

Are the above rules written correct or am i doing some mistake here?

Please help. Thank you.
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: Rules giving inappropriate results.

Post by Gregor Koch »

ravi.ahuja21 wrote: I have an HR Cube having the following dimension
Function
Facility
Department
Nature
Employee
Scenario
Year
Months
Employee Measures.

I am trying to get data from a Employee master cube having dimensions
Facility
Department
Nature
Employee
Scenario
Year
Months
Employee Master Measures.

Code: Select all


# get vacation hours.
['Budgeted','Vacation Hours']=N:DB('Employee Master',!Facility,!Department,!Central Nature,!Year,!Months,'HR',!Employee,'Accrued Vacation Hours');

Just wondering how this would compile in the first place as you don't have a 'Central Nature' dimension in your HR cube.
You are best of to post code as it is, in order and in which cube, otherwise everybody will be just guessing
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Rules giving inappropriate results.

Post by Steve Rowe »

Hi Ravi,

Assuming the following
That nature and Central Nature are the same dimension
The rule saves without error.

Then I think your rules look OK, try using the rule tracer on a cell that previously returned a value but then does not to see if you can track the issue. (its on the right click just in case).

You also want to put some conditions on your working days and holdays rules as the dimensionality is much less in the source cube as in the destination. If you don't you are going to populate these measures at lots of redundant intersections. (usually you would use something like is headcount > 0)

HTH
Technical Director
www.infocat.co.uk
ravi.ahuja21
Posts: 33
Joined: Tue Aug 30, 2011 8:34 am
OLAP Product: TM1
Version: 9.5
Excel Version: 10.0

Re: Rules giving inappropriate results.

Post by ravi.ahuja21 »

Hi Gregor,

I am sorry , Nature and Central Nature both are same. Extremely sorry for this mistake. Thanks for your time I appreciate that.


Hi Steve,

Thanks for the solution. What I did is I wanted to calculate the regular hours of the employee and the formula was (working days * 8)* No of employees.

So i have applied this rule now and it works fine. I will check out with the solution given by you.

Thanks for your precious time mate.
Post Reply