Elements with Same Name

Post Reply
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

Elements with Same Name

Post by ViRa »

Hi all,

I have a dimension which stores member names as elements. I created the element in TI process by concatenating member's first name and last name. However, since only unique element names can be created and stored in a dimension, the members whose names are same as others are not being created. In order to make the names unique I could concatenate them with their respective ages eg. Stephen Connoly_55, Stephen Connolly_8 but the requirement is not to display the age in the name as it looks odd. Else, I can concatenate the age only when the first and last names of members match to make them unique.

So while defining the element in the TI process, I'm stuck at the syntax to define during the IF condition.

vMemName = Mem_First_Name |' '| Mem_Last_Name;
If (.....);
vMemName = Mem_First_Name |' '| Mem_Last_Name |'_ '| Age;
Endif;

I'd appreciate if somebody could assist me how to put across the condition to identify same first names and last names within IF function.

Thanks for your time and help.
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Elements with Same Name

Post by Alan Kirk »

My first suggestion is... never use people's names as the principal name of an element in a dimension. As you've found even in a relatively small group they aren't always unique. The principal name should be an artificial key; membership number, employee number, etc. You then use an alias for a descriptive name.

Second, I don't think that appending their ages is a good idea. First, some people could get hacked off about that if they find out about it. Second, the age changes. You might create a name like John Smith 53. So what happens when you do a data feed after their next birthday? The TI would take a look at their age then, see that there is no John Smith 54 and create the new element. Boom, you have a duplication.

Third, I don't recommend creating an alias using convoluted If-Then-Maybe rules; keep every alias using the same naming pattern, otherwise you end up with "If there's already a John Smith then you create John Smith 53 instead assuming that this John Smith isn't in fact the same as that John Smith oh dear how do we check that?".

Given that you cannot have two elements with the same name (as you'd never be able to tell which one is which in a report, and certainly the system couldn't when doing data uploads), I'd make an alias look something like First Name Last Name (Member Number). Since it always follows the same pattern you never have to worry about Ifs. Since it embeds a unique identifier you never have to worry about having two members with the same name. Since you don't use an age you never have to worry about it changing or about one of the members wanting to thump you for violating their privacy. It's a win-win situation.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Elements with Same Name

Post by declanr »

I agree with everything Alan has said there, a person's name as an element is a big no no in development of TM1 and most other systems.
Also as to appending the ages you will find a lot of companies will have a big restriction on what is visible even internally; most I have worked with in the UK would regard Age, D.O.B, sex etc as requiring just as much protection as salaries and home addresses.

Pretty much every dimension whether it is the name of a person, company, department, product etc should nearly all in most circumstances be sourced from another database of some kind; it is very rare that TM1 is the first source of entry for such dimensions in a company. As such it is very likely that the source system will have already given the record a unique identifier itself; I would just use that as the element name and then concatenate it with the actual name for an alias.
Declan Rodger
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

Re: Elements with Same Name

Post by ViRa »

Thanks Alan and Declanr for your guidance and correcting me. Helps me learn a lot. I've modified the structure as per your suggestion.
Thanks again.
Post Reply