Change dimension element from string to simple

Post Reply
tez
Posts: 40
Joined: Tue Dec 21, 2010 12:43 am
OLAP Product: Cognos Express
Version: 10.2.1 FP3
Excel Version: 2013

Change dimension element from string to simple

Post by tez »

Hi

I've just found some elements in a dimension that were created as a string type rather than simple. It's not a measure dimension nor the last dimension in the order in cubes, so it's strange that it hasn't seemed to cause any issues to date.

I've tried various ways to change the type, via a TI process & manually change the type in edit dimension structure, but when I do, it deletes the data in the cubes where this dimension is used.

Does anyone know if you should be able to change the type without losing data?

Many thanks
Terri
Alan Kirk
Site Admin
Posts: 6647
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: Change dimension element from string to simple

Post by Alan Kirk »

tez wrote:Hi

I've just found some elements in a dimension that were created as a string type rather than simple. It's not a measure dimension nor the last dimension in the order in cubes, so it's strange that it hasn't seemed to cause any issues to date.
No it isn't. From Your Friend The Manual (though I'll admit that this reference is a sod to find; it's in the Developer Guide):
String

Stores text strings in cells. To include a string in a cell in a cube, the element from the last dimension defining the cell must be a string element. TM1 treats string elements that occur in any dimension other than the last one as numeric elements.

The typical use for string elements is in a two-dimensional cube that converts codes in an input file to formal element names. For example, if you want to convert account codes to account names.
(My emphasis added.)

The paragraph after that shows you how long ago this was written; that smells of pre-version 7 and pre-aliases. That would hardly be a "typical use" for them these days...
tez wrote:I've tried various ways to change the type, via a TI process & manually change the type in edit dimension structure, but when I do, it deletes the data in the cubes where this dimension is used.
Unsurprising; a string element and an N element are two different objects so when you "replace" one with another you're really deleting one and creating a new one. That way, you lose data.
tez wrote:Does anyone know if you should be able to change the type without losing data?
Option 1 is don't worry about it; as noted above TM1 will just treat it as an N anyway.

Option 2 is to do like we used to have to in the old version 6 days when we changed an element name because we didn't have aliases; export all of the data to a text file, recreate the element, then import it back in.

(Of course back then we had to use map sheets and/or Data Control (if anyone remembers that abomination), since TI did not yet exist. So depending on the amount of data involved there could be time to put one's feet up on the desk and read a novel while it reloaded. Unfortunately it's a truism that the "good old days" were never really that good while you were actually there.)
"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.
tez
Posts: 40
Joined: Tue Dec 21, 2010 12:43 am
OLAP Product: Cognos Express
Version: 10.2.1 FP3
Excel Version: 2013

Re: Change dimension element from string to simple

Post by tez »

Hi Alan

Thanks for all that info, much appreciated! I hadn't seen that TM1 treats strings as numeric if not in the last dim...very handy to know, & I'm glad I wasn't around in pre-alias days, that sounds horrendous! :o

I'll consider the export/import solution, I don't think the data size is too big at this stage, so best time is to do it now before any more data is added.

Thanks for your help & have a great day.

Cheers
Terri
Post Reply