Unique attribute error

Post Reply
gbehel
Posts: 49
Joined: Fri Dec 27, 2013 8:35 am
OLAP Product: TM1, Cognos EP, Contributor
Version: 10.2.2
Excel Version: 2013
Location: India

Unique attribute error

Post by gbehel »

Hello all,

I have designed the following Alternate hierarchy :

Total Region
Primary Hierarchy
-------RM1
-------RM2
----------Ch1
Derived Hierarchy
-------RM4
-------RM6
----------Ch1

Total Region = Primary + derived

Data for Primary and Derived are coming from 2 different files. The TI code works fine for the first file. however while running the code for the second file, the process is completed with the following warning.

Data procedure line (5): The attribute is not unique. Ch1 ~ Aktiengesellschaft, domestic bank can not be set as an attribute for element Desc Ch1 in dimension region.

I checked the records of both the file. Atrribute descirption of Ch1 matches.

Even though the hierachies are built fine, attributes for some of the elements are missing in the second hierarchy citing the above warning.

What could be the reason for this?

Any suggestion/advice is most welcome

Regards
Gbehel
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

Re: Unique attribute error

Post by dan.kelleher »

Hi Gbehel,

Can you post your code and the source files you are using? Anonymise the data if necessary. The error message is because you are trying to assign an alias of " Ch1 ~ Aktiengesellschaft, domestic bank" to an element called "Desc Ch1", but this alias already exists for another element, probably "Ch 1".

Thanks,

Dan
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Unique attribute error

Post by BariAbdul »

"You Never Fail Until You Stop Trying......"
gbehel
Posts: 49
Joined: Fri Dec 27, 2013 8:35 am
OLAP Product: TM1, Cognos EP, Contributor
Version: 10.2.2
Excel Version: 2013
Location: India

Re: Unique attribute error

Post by gbehel »

All,
Code as Follows :

##START OF PRIMARY HIERARCHY - SOURCEFILE1###
PROLOG
########
vDim='Region';

if(DimensionExists(vDim)=1);
ATTRDELETE(vDim,'Desc');
DIMENSIONDESTROY(vDim);
endif;

DIMENSIONCREATE(vDim);
DIMENSIONSORTORDER(vDim,'BYINPUT','ASCENDING','BYINPUT','ASCENDING');
ATTRINSERT(vDim,'','Desc','A');

#########

METADATA
vdim ='Region';
if(vMem_Aggr@='+' % vMem_Aggr@='');
vAggr=1;
Elseif(vMem_Aggr@='-');
vAggr=-1;
else;
vAggr=0;
Endif;

DIMENSIONELEMENTINSERT(vDim,'',vParent,'C');
DIMENSIONELEMENTINSERT(vDim,'',vMember,'N');
DIMENSIONELEMENTCOMPONENTADD(vDim,vParent,vMember,vAggr);
#############

DATA
ATTRPUTS(vDescription,vDim,vMember,'Desc');
##END OF PRIMARY HIERARCHY - SOURCEFILE1###

##START OF DERIVEDHIERARCHY - SOURCEFILE2###
METADATA

vDim='Region';
if(vMem_Aggr@='+' % vMem_Aggr@='');
vAggr=1;
Elseif(vMem_Aggr@='-');
vAggr=-1;
else;
vAggr=0;
Endif;

DIMENSIONELEMENTINSERT(vDim,'',vParent,'C');
DIMENSIONELEMENTINSERT(vDim,'',vMember,'N');
DIMENSIONELEMENTCOMPONENTADD(vDim,vParent,vMember,vAggr);
#############

DATA
ATTRPUTS(vDescription,vDim,vMember,'Desc');
##ENDOF DERIVEDHIERARCHY - SOURCEFILE2###

Example : thers is this element '0100' with alias name '0100~hundred'. This elements appears in both the source file with exactly the same alias name under different parent elements. While the process runs fine for primary hierarchy and assign correct alias, the second process throws this error. The second process however insersts the element at a corret level without assigning a alias to it

Hope im clear.. restarting teh server is not an option since i work from a remote location and dont control the serve adminsitration.

Please help

regards
Gbehel
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: Unique attribute error

Post by declanr »

Giresh,

As Dan Kelleher pointed out you aren't able to have 2 separate elements with the same alias;
An Alias can not be:
  • The same as another element's Alias.
  • The same as another element's principal name (with the exception of it's own element's principal name)

If you absolutely need both to have the same alias I would recommend prefixing the alias with the principle name, that way you can guarantee that all will be unique.



EDIT - Principle / Principal... one day I will remember this...
Declan Rodger
gbehel
Posts: 49
Joined: Fri Dec 27, 2013 8:35 am
OLAP Product: TM1, Cognos EP, Contributor
Version: 10.2.2
Excel Version: 2013
Location: India

Re: Unique attribute error

Post by gbehel »

Hi Rodger,

I made a typing mistake in my original post. In my last reply, i have mentioned that the element name is same in both the hierarchies (including the alias name). This is one single element shared by 2 hierarchies. However each hierarchy is brought in region dimension using 2 TIs and separate source files.

The first source file/TI runs fine. However while appending the dimension with the second TI for derived hierarchy, i get this warning
.
Regards
Girish
gbehel
Posts: 49
Joined: Fri Dec 27, 2013 8:35 am
OLAP Product: TM1, Cognos EP, Contributor
Version: 10.2.2
Excel Version: 2013
Location: India

Re: Unique attribute error

Post by gbehel »

as suggested by bariabdul and this post viewtopic.php?f=3&t=9099

im wondering has it something to do with alias being cached. I renamed the dimension name in the code and both the TI process ran without any error. This was however only true with the first run. on the second run, the second TI threw the same warning before completing the process

Any thoughts?

Regards
Gbehel
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

Re: Unique attribute error

Post by dan.kelleher »

Hi gbehel,

If you are processing the same files over and over, then I wouldn't have thought this would be an issue with caching. This caching issue only occurs when you change an alias in the file and rerun.

Without looking at your complete code and example source files where the issue can be replicated, it is hard to debug the issue.

Have you tried using source files with just one row in each (i.e. the '0100' with alias name '0100~hundred' example you gave) to see if this still gives you the issue? I would try this and create a new dimension by renaming and then rerun to reproduce the issue in the simplest format.

Hopefully you can then attach the code and simple source files to this post so I can replicate your issue.

Thanks,

Dan
gbehel
Posts: 49
Joined: Fri Dec 27, 2013 8:35 am
OLAP Product: TM1, Cognos EP, Contributor
Version: 10.2.2
Excel Version: 2013
Location: India

Re: Unique attribute error

Post by gbehel »

Thanks Dan,

You are right about the alias value being cached during renam. It should not happen on the rerun of a code. Trim function did the trick

The basic problem was in the data. Even though element '0100' had '0100~hundred' as Alias, there was a space in the prefix. I missed reading the data correctly :cry:

Problem solved

thanks you all for your quick responses

Regards
Gbehel
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: Unique attribute error

Post by Alan Kirk »

declanr wrote:EDIT - Principle / Principal... one day I will remember this...
Schoolboy mnemonics:
The principal (first, primary teacher) is your "pal". (How many schoolboys bought into this, I have no idea.) Ergo the first or primary thing is the "pal" spelling, ergo the "ple" spelling is the more abstract one.

Similarly you buy stationery from a stationer, not a stationar. Therefore the paper one is the "ery" spelling and the "stand still" spelling must be "ary". Of course that one probably worked better back in the '30's to '60's before stationers became an endangered species as a result of places like Officeworks. (Approximate equivalent in the US = Staples, I think; approximate equivalent in the UK = ... no idea.)
"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.
Post Reply