Page 1 of 1

Transfer data from attributes to cube with rules

Posted: Fri Jan 07, 2011 12:09 pm
by tm1starter
Hello all,

I have the next problem;

I have a employee cube with the next dims (simplified);
- Employee
- EmployeeType (elements I and E)
- Measure (element FTE)
- Period

and the Employee dim has the next attributes;
- FTE (Value between 0 and 1)
- EmployeeType (Value I or E)

With a rule I want to fill the cube with the FTE's out of the attribs in the Emloyee dim, the FTE's should be the same in all months, for example

Dimension.
employee FTE EmployeeType
Employee1 1 I


Cube

EmployeeType I
Measure FTE

Period
01 02 03 ...
Employee1 1 1 1 ...


With a TI proces it's quite simple to load the cube, but how is it done with a rule?

I come this far;

Code: Select all

['FTE' ] = DB('}ElementAttributes_Employee', !Employee, 'FTE');
But then the EmployeeType is not taken into account and on both I and E values are set.

I have tried this;

Code: Select all

['FTE' ] = If( DB('}ElementAttributes_Employee', !Employee, 'EmployeeType')=!EmployeeType,
					DB('}ElementAttributes_Employee', !Employee, 'FTE'),
					0); 
But this also doesn't work

Can someone help me :?:

Re: Transfer data from attributes to cube with rules

Posted: Fri Jan 07, 2011 12:26 pm
by Steve Vincent
is it only the I type of employee you wish to fill the value for FTE? If so, try;

Code: Select all

['FTE', 'I'] = DB('}ElementAttributes_Employee', !Employee, 'FTE');

Re: Transfer data from attributes to cube with rules

Posted: Fri Jan 07, 2011 12:34 pm
by tm1starter
It is not only the I type, I and E are used both.

I don not also want this one;

Code: Select all

['FTE', 'I'] = IF(DB('}ElementAttributes_Employee', !Employee, 'EmployeeType')='I'
                       DB('}ElementAttributes_Employee', !Employee, 'FTE'),
                       CONTINUE);
['FTE', 'E'] = IF(DB('}ElementAttributes_Employee', !Employee, 'EmployeeType')='E'
                       DB('}ElementAttributes_Employee', !Employee, 'FTE'),
                       CONTINUE);
I want a general rule, so when I'm adding types there is no problem

Re: Transfer data from attributes to cube with rules

Posted: Fri Jan 07, 2011 1:40 pm
by tomok
tm1starter wrote:I have tried this;
['FTE' ] = If( DB('}ElementAttributes_Employee', !Employee, 'EmployeeType')=!EmployeeType,
DB('}ElementAttributes_Employee', !Employee, 'FTE'),
0);
But this also doesn't work?
This should work but the problem is in your rule syntax. When comparing strings you use "@=". Change the above to:

['FTE' ] = If( DB('}ElementAttributes_Employee', !Employee, 'EmployeeType')@=!EmployeeType,

Re: Transfer data from attributes to cube with rules

Posted: Fri Jan 07, 2011 2:18 pm
by tm1starter
Indeed this works, Thnx!

I'm a bit shamed, about this error :oops: