Page 1 of 1

Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 5:53 am
by Jackymyc
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

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 6:47 am
by ascheevel
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.

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 6:55 am
by Jackymyc
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.

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 6:59 am
by ascheevel
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?

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 7:13 am
by Jackymyc
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.

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 7:31 am
by ascheevel
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');

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 7:33 am
by Wim Gielis
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.

Re: Cannot insert new element in element attribute dimension

Posted: Fri Nov 10, 2017 7:57 am
by Jackymyc
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.