Page 1 of 1

Rules giving inappropriate results.

Posted: Tue Oct 04, 2011 8:10 pm
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.

Re: Rules giving inappropriate results.

Posted: Tue Oct 04, 2011 10:38 pm
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

Re: Rules giving inappropriate results.

Posted: Wed Oct 05, 2011 8:47 am
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

Re: Rules giving inappropriate results.

Posted: Wed Oct 05, 2011 1:45 pm
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.