Page 1 of 1

Linking attribute values to a dimension member without DIMIX

Posted: Wed Jun 05, 2013 8:10 am
by Jaan
Hi,

I was wondering is there a better way to link an attribute value of a source dimension member to a member of another dimension (e.g. personnel cube has a dimension "personnel", which has an attribute called department. Personnel cube doesn't have an Entity dimension. In the SalaryPlanning cube I have to link the salary of each person to an Entity dimension member where the person belongs to.)? My current solution uses DIMIX as a function. However, it seems that after every deletion of a member in the target dimension (or even restructuring the target dimension, e.g. adding a new consolidated member), TM1 reshuffles the indexes and as a result the formula gives me RULE LINE ERROR. After regenerating the formula I get the data back but it doesn't seem like a working solution to me.
So, in order not to reinvent the wheel, maybe somebody has already worked out a solution for it and could help me out.

Thanks,
Jaan

Re: Linking attribute values to a dimension member without D

Posted: Wed Jun 05, 2013 10:08 am
by Harvey
I'm having trouble understanding your question. Could you post the rule and a screenshot of the dimensions in question in line with the Request for Assistance Guidelines ?

Generally speaking, if you're just talking about storing the associated Entity element for each Employee, it's common practice to store the element name in a string attribute, and then refer to that in your rules.

It's really best practice to avoid using element indexes at all, unless you can be totally certain the dimension won't be edited.

Re: Linking attribute values to a dimension member without D

Posted: Wed Jun 05, 2013 1:32 pm
by Jaan
Well, to scale it down to the problem, let's assume the situation is in principle as follows:
Let's say I have a Personnel cube, which consists of 3 dimensions: Personnel, SalaryMeasures and Time.
Personnel dimension has an attribute called Department, which is of string type.
Personnel dimension members and their corresponding attribute values:

John Smith - AccountingDepartment
Bob Brown - HRDepartment
Susan Snow - AccountingDepartment

Personnel cube has the following values:

SalaryMeasure = "Salary"

Jan Feb
John Smith 1000 1000
Bob Brown 1200 1200
Susan Snow 1300 1300

Now, SalaryPlanning cube has also 3 dimensions - Entity, SalaryMeasures and Time
Entity dimension has the following members:
AccountingDepartment
HRDepartment

The SalaryPlanning cube should have the following values:
SalaryMeasure = "Salary"

Jan Feb
AccountingDepartment 2300 2300
HRDepartment 1200 1200

The code I was using is as follows

[] = S:IF(DIMIX('Entity', !Entity) <> DIMIX('Entity', ATTRS('PersonnelData',
!PersonnelData, 'Department')), CONTINUE, DB('SalaryPlanning',
!PersonnelData, !Time, !Version, !SalaryPlanningMeasures));
[] = N:IF(DIMIX('Entity', !Entity) <> DIMIX('Entity', ATTRS('PersonnelData',
!PersonnelData, 'Department')), CONTINUE, DB('SalaryPlanning',
!PersonnelData, !Time, !Version, !SalaryPlanningMeasures));

As you can see the rule doesn't match one-to-one the situation described, but I hope you get the idea.
TM1 version is 10.1.

Re: Linking attribute values to a dimension member without D

Posted: Wed Jun 05, 2013 9:54 pm
by tomok
Why would you compare index numbers? Just compare to the actual Entity element itself:

Code: Select all

[] = S:IF(!Entity@<>, ATTRS('PersonnelData',!PersonnelData, 'Department')), CONTINUE, DB('SalaryPlanning',
!PersonnelData, !Time, !Version, !SalaryPlanningMeasures));

Re: Linking attribute values to a dimension member without D

Posted: Thu Jun 06, 2013 11:36 am
by Jaan
Thanks!

This seems to work. How simple!