TM1 Duplicate Element Delete Process

Post Reply
mastertito4
Posts: 35
Joined: Fri Oct 15, 2010 7:29 pm
OLAP Product: IBM Cognos TM1
Version: 9.5+
Excel Version: 2007 and 2003
Location: Minneapolis, MN, USA

TM1 Duplicate Element Delete Process

Post by mastertito4 »

I have searched through the forums and was able to find any help regarding a possible process that would delete duplicate elements within the same roll-up/hierarchy.

I have a products dimensions with 9 different roll-ups, and one (and most likely many others) of my elements actually appears 11 times. I have confirmed that it is showing up in the same roll-up twice, same element with the same attributes, data, etc. Since I am dealing with around 5000 unique elements in this dimension I was hoping there would possibly be a process that can be written to delete the extra elements?

Example of the error:

Σ-Material Type
Σ-Market Segment
_____Σ-MKT_A
________n-PARTNUMBER_12345
________n-PARTNUMNER_12346
_______n-PARTNUMBER_12347
_____Σ-MKT_B
________n-PARTNUMBER_12340
________n-PARTNUMBER_12345
Σ-End Customer Group

So Market Segment is one of multiple roll-ups, but with in one single roll-up (market segments) the same element is appearing twice.


I was hoping to write a process that would do something similar to the following:

IF element exists more than once in a given roll-up,
Delete all those elements, then, Create that element once.
Else,
STET

Any thoughts? I am relatively new to TM1, I have been working on it all day every day for a month and a half now.

THANKS!
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TM1 Duplicate Element Delete Process

Post by tomok »

Is it appearing more than once in the actual dimension or just more than once when you are looking through the subset editor? There is a huge difference.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
mastertito4
Posts: 35
Joined: Fri Oct 15, 2010 7:29 pm
OLAP Product: IBM Cognos TM1
Version: 9.5+
Excel Version: 2007 and 2003
Location: Minneapolis, MN, USA

Re: TM1 Duplicate Element Delete Process

Post by mastertito4 »

Both.

it shows up 11 times in the actual dimension, when there is only different 9 roll-ups.
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: TM1 Duplicate Element Delete Process

Post by kpk »

It is probably a slowly changing dimension hierarchy therefore you need to destroy the hierarchy in the prolog session everytime before rebuilding it.

dimension='aaa';

num_of_elements=DIMSIZ(dimension);
index1=1;
while(index1<=num_of_elements);
element=DIMNM(dimension, index1);
num_of_parents=ELPARN(dimension,element);
index2=1;
while(index2<=num_of_parents);
parent=elpar(dimension,element,1);
DimensionElementComponentDelete(dimension,parent,element);
index2=index2+1;
end;
index1=index1+1;
end;
Best Regards,
Peter
mastertito4
Posts: 35
Joined: Fri Oct 15, 2010 7:29 pm
OLAP Product: IBM Cognos TM1
Version: 9.5+
Excel Version: 2007 and 2003
Location: Minneapolis, MN, USA

Re: TM1 Duplicate Element Delete Process

Post by mastertito4 »

I will give that a shot.

Thank you very much Peter!
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: TM1 Duplicate Element Delete Process

Post by kpk »

Best Regards,
Peter
mastertito4
Posts: 35
Joined: Fri Oct 15, 2010 7:29 pm
OLAP Product: IBM Cognos TM1
Version: 9.5+
Excel Version: 2007 and 2003
Location: Minneapolis, MN, USA

Re: TM1 Duplicate Element Delete Process

Post by mastertito4 »

Found the problem,

in the data source we were seeing elements named something like

PARTNUMBER 111 234 456X

and

PARTNUMBER111234456X,

TM1 was loading both of these into the same roll-up and making both of them in the first format
"PARTNUMBER 111 234 456X"

Not quite sure why it got rid of the spaces in the second one, but it did.
Paul Segal
Community Contributor
Posts: 314
Joined: Mon May 12, 2008 8:11 am
OLAP Product: TM1
Version: TM1 11 and up
Excel Version: Too many to count

Re: TM1 Duplicate Element Delete Process

Post by Paul Segal »

mastertito4 wrote:Not quite sure why it got rid of the spaces in the second one, but it did.
As we know, Jim, TM1 always disregards spaces in element names. PARTNUMBER 1111 is the same element as PARTNUMBER1111 as fas as TM1 is concerned.

Best
Paul
Post Reply