Cannot insert new element in element attribute dimension

Post Reply
Jackymyc
Posts: 4
Joined: Thu Aug 17, 2017 3:57 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Cannot insert new element in element attribute dimension

Post by Jackymyc » Fri Nov 10, 2017 5:53 am

Hi all,

Right now, i am trying to insert a new element into a ElementAttribute dimension. The normal way of me doing in a normal dimension (not element attribute dimension) is to right click onto the dimensionm and select "Edit Dimension Structure". But when i try to do this with my element attribute dimension, the selection went dim and cannot be select. Is this the correct way to insert a element in element attribute dimension?

Secondly, while i failed to insert it with the way mention above, i did tried to insert in through DimensionElementInsert method. This works perfectly fine until whenever i tried to insert something to thr newly added element, obtabCellWriteStatusGet() = 140 occurred. Is there something i should pay attention to.

Thank you for all the help i can get

ascheevel
Posts: 9
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: 11.2
Excel Version: 2016

Re: Cannot insert new element in element attribute dimension

Post by ascheevel » Fri Nov 10, 2017 6:47 am

You can right-click the dimension in server explorer, select Edit Element Attributes, and then Edit->Create New Attribute or you can use DimensionAttrInsert in a TI process.

Jackymyc
Posts: 4
Joined: Thu Aug 17, 2017 3:57 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Cannot insert new element in element attribute dimension

Post by Jackymyc » Fri Nov 10, 2017 6:55 am

Thank you for your rapid reply.

This is exactly i tried to do, but the "Edit Dimension Structure" cannot be select (dim).

Using the ti process method is fine until i tried to insert value into the element, and result the error i mention with my previous post.

ascheevel
Posts: 9
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: 11.2
Excel Version: 2016

Re: Cannot insert new element in element attribute dimension

Post by ascheevel » Fri Nov 10, 2017 6:59 am

Are you right-clicking on the attribute dimension or the dimension whose elements you're trying to add attributes for? For example, if I want to add a new attribute to a Product dimension, I right-click the "Product" dimension and select "Edit Element Attributes...", not the "}ElementAttributes_Product" dimension and "Edit Dimension Structure...".

Edit:
Using the TI process, are you inserting the attribute in the Prolog Tab? How are you then trying to add a value to the attribute, are you using AttrPutS or AttrPutN?

Jackymyc
Posts: 4
Joined: Thu Aug 17, 2017 3:57 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Cannot insert new element in element attribute dimension

Post by Jackymyc » Fri Nov 10, 2017 7:13 am

Let me explain my problem in detail here.

Lets say i have a dimension call tradeId, where it stores id import from db. I also have a ElementAttribute cube where it stores some kind of attributes for each of the trade id (attribute a, b, c etc..) the goal i am trying to achive is to add a new attribute for each of the tradeId, let say attribute d.

Yes, i am using AttPutN to insert into the element attribute cube.

ascheevel
Posts: 9
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: 11.2
Excel Version: 2016

Re: Cannot insert new element in element attribute dimension

Post by ascheevel » Fri Nov 10, 2017 7:31 am

Below is sample code for adding "Description" as an attribute to TradeID assuming the TradeID is variable V1 and description is variable V2 off your datasource.

Prolog tab:

Code: Select all

AttrInsert('TradeID, '', 'Description', 'S');

Data tab:

Code: Select all

AttrPutS(V2, 'TradeID', V1, 'Description');

Wim Gielis
MVP
Posts: 1562
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Cannot insert new element in element attribute dimension

Post by Wim Gielis » Fri Nov 10, 2017 7:33 am

As was said before, You can right-click the dimension in server explorer, select Edit Element Attributes, and then Edit->Create New Attribute or you can use AttrInsert in a TI process.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 104 TM1 articles and a lot of custom code
Newest blog article: Delete a cube and its dimensions

Jackymyc
Posts: 4
Joined: Thu Aug 17, 2017 3:57 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Cannot insert new element in element attribute dimension

Post by Jackymyc » Fri Nov 10, 2017 7:57 am

Dear a,

I got it using was's method. Lesson learned. I am suppose to edit the dimension's element attribute, rsther than directly edit the element attrbute's dimension.

Thx for all the help guys.

Post Reply