SR 86622 999 616 DimensionElementComponentAdd data loss

Post bug reports and the status of reported bugs
Post Reply
User avatar
Alan Kirk
Site Admin
Posts: 5724
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: 9.5.2 64 bit moving to 10.2.2
Excel Version: 2010
Location: Sydney, Australia
Contact:

SR 86622 999 616 DimensionElementComponentAdd data loss

Post by Alan Kirk » Wed Nov 11, 2009 9:09 pm

This was originally reported to Applix as issue 363783 but never resolved.
The problem can be replicated as follows:
- Create a new dimension with a single element.

- Use DimensionElementInsert to insert two new N level elements.
This will give you three N level elements in the dimension.

- In a second process, use DimensionElementInsert to try to insert one of the existing elements as a C level element.

This will cause no change to the dimension, but nor will it cause an error or a reject. The lack of a reject / error when the element is OF THE SAME TYPE is a good thing. It means that TI will just ignore any existing elements if you need to loop through a data source, adding all of the elements from that source. The lack of a reject / error where the type DIFFERS is more questionable since it's most likely to be caused by a programming error by the TI developer or an error in the source data. However it's still harmless as it makes no change to the dimension.

- In a third process, use DimensionElementComponentAdd to add one of your N level elements as a child of one of the other N level elements.

This will cause the other N level element to be converted from an N type to a consolidation, blowing away any data that had been entered against it.

I believe that it would be more desirable for an attempt to do that to generate an error, and for either:
(a) The programmer to have to delete the N level element and recreate it as a C level element rather than having DimensionElementComponentAdd do an implicit conversion; or
(b) Create functions which have to be explicitly called to do a conversion.

At the very least, the documentation should be changed to warn users that they could lose data if they accidentally add an element as a child of another N level element.
Edit: Although the old Forum didn't allow you to receive copies of your own e-mails the way more modern, sleek ones do, I found the e-mail from the posting that Curmudgeon made in the thread that's linked to above. The original report wasn't as long ago as I thought; 8 February 2008, apparently.
"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.

User avatar
Martin Ryan
Site Admin
Posts: 1947
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: SR 86622 999 616 DimensionElementComponentAdd data loss

Post by Martin Ryan » Sat Nov 14, 2009 11:42 am

Alan Kirk wrote: At the very least, the documentation should be changed to warn users that they could lose data if they accidentally add an element as a child of another N level element.
This would be my preferred solution. I use this "feature" quite a lot, import all elements as "N" level, regardless of whether they will continue to be N level and then stick children against them, so I'd find an error very annoying. I guess an alternative function that returns an error in this situation would be a useful compromise, but I wouldn't want the DimensionElementComponentAdd to error out in this instance.

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer

User avatar
Alan Kirk
Site Admin
Posts: 5724
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: 9.5.2 64 bit moving to 10.2.2
Excel Version: 2010
Location: Sydney, Australia
Contact:

Re: SR 86622 999 616 DimensionElementComponentAdd data loss

Post by Alan Kirk » Sun Nov 15, 2009 11:20 pm

Martin Ryan wrote:
Alan Kirk wrote: At the very least, the documentation should be changed to warn users that they could lose data if they accidentally add an element as a child of another N level element.
This would be my preferred solution. I use this "feature" quite a lot, import all elements as "N" level, regardless of whether they will continue to be N level and then stick children against them, so I'd find an error very annoying. I guess an alternative function that returns an error in this situation would be a useful compromise, but I wouldn't want the DimensionElementComponentAdd to error out in this instance.
OK, I've added your comments to the SR. My own feeling was based on the fact that this breaches the first commandment of any data system; "You shalt not trash your data nor cause it to be accidentally trashed". I'd rather be required to do an explicit conversion from N to C rather than run the risk that the code will do it for me without warning.
"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.

User avatar
Alan Kirk
Site Admin
Posts: 5724
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: 9.5.2 64 bit moving to 10.2.2
Excel Version: 2010
Location: Sydney, Australia
Contact:

Re: SR 86622 999 616 DimensionElementComponentAdd data loss

Post by Alan Kirk » Fri Jan 08, 2010 2:01 am

From support:
I have now heard back from engineering on this defect but they have not yet had a chance to review. The feedback was that this was a P4 and was not a priorty.
It will therefore remain a case of "proceed with caution" when writing code that does this sort of thing.
"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