Page 1 of 1

ATTRS function

Posted: Fri Jun 08, 2012 6:14 am
by rahul1tm1
Hi

I am trying to create new dimension and fill elements using TI process. It reads from an existing dimension element attribute values and creates element names with the source Attribute names read before. It does the job perfect, however it does NOT create new elements in new Dim if
Source Dimnm=Alias Name
i.e. It creates new elements only if alias attribute value is different from element value in source dim.

Any ideas why is it happening?

Code: Select all

## It has 3 parameters and 3 variables ##

VDimname=P_Dimname;
VAttributename=P_AttributeName;
VDname=P_DimToCreate;

DimensionCreate(VDname);
vindex=1;

While(vindex<=vdimsiz);
   velname=DIMNM(vdimname, vindex);
    VAttributevalue=ATTRS(VDimname, velname,VAttributename);
    DimensionElementInsert(VDname,'',VAttributevalue ,'N');
    vindex=vindex+1;
end;


Re: ATTRS function

Posted: Fri Jun 08, 2012 6:39 am
by Olivier
Hi there,

I have not recheck that specifically, but I think TM1 display "empty" alias attribute value to be the original element name but does not automatically populate the "alias" in the element attribute cube.
I think the alias value might still be empty in the dimension attribute cube which could explain why your process does not pick up these elements based on your test.

1 / try to look into the element attribute cube to validate these aliases not pick up are physically empty
2 / adapt your code so when alias value is empty, you will pick the element name directly

Hope this helps,

Re: ATTRS function

Posted: Fri Jun 08, 2012 9:06 am
by rahul1tm1
Olivier wrote:Hi there,

I have not recheck that specifically, but I think TM1 display "empty" alias attribute value to be the original element name but does not automatically populate the "alias" in the element attribute cube.
I think the alias value might still be empty in the dimension attribute cube which could explain why your process does not pick up these elements based on your test.

1 / try to look into the element attribute cube to validate these aliases not pick up are physically empty
2 / adapt your code so when alias value is empty, you will pick the element name directly

Hope this helps,
Hi Olivier,
There are values in Alias and none of the alias values are empty. Some values match with element values and the rest has different (actual) alias values.

Re: ATTRS function

Posted: Fri Jun 08, 2012 9:15 am
by Michel Zijlema
rahul1tm1 wrote:There are values in Alias and none of the alias values are empty. Some values match with element values and the rest has different (actual) alias values.
Did you check this in the Attributes Editor or using a direct browse on the regarding }ElementAttributes cube? If no alias is set the alias entry is empty in the }ElementAttributes cube (and will be retrieved as such using AttrS in TI), but the Attributes Editor will still display the element name as the alias.

Michel

Re: ATTRS function

Posted: Sat Jun 09, 2012 12:51 am
by Olivier
If no alias is set the alias entry is empty in the }ElementAttributes cube (and will be retrieved as such using AttrS in TI)
it is because one's did not specify the aliases value so you have somewhere a trace that you left some unspecified alias.
then you could hunt them to populate them if you do so on the base of a source which will get these in the future...

Hopefully, Michel is much clearer then me ;)

Re: ATTRS function

Posted: Mon Jun 18, 2012 6:28 am
by rahul1tm1
Michel Zijlema wrote:
rahul1tm1 wrote:There are values in Alias and none of the alias values are empty. Some values match with element values and the rest has different (actual) alias values.
Did you check this in the Attributes Editor or using a direct browse on the regarding }ElementAttributes cube? If no alias is set the alias entry is empty in the }ElementAttributes cube (and will be retrieved as such using AttrS in TI), but the Attributes Editor will still display the element name as the alias.

Michel
Michel,

Wow!! You are right! There are NO alias values shown in Control cube, even though in Attributes Editor it shows Alias values.
You have solved the mistery.
What if I fill Attribs values in Control cube cells, will that help achieve my objectives? Is that the only (or standard) way to solve such problems?

Thanks again!

Re: ATTRS function

Posted: Mon Jun 18, 2012 7:29 am
by Michel Zijlema
rahul1tm1 wrote:What if I fill Attribs values in Control cube cells, will that help achieve my objectives? Is that the only (or standard) way to solve such problems?

Thanks again!
You either need to explicitely assign an alias value (f.i. the element name) or take into account that the value can be empty in your rules or TI code (f.i. by checking on empty value and selecting the element name instead if this is the case).

Michel

Re: ATTRS function

Posted: Mon Jun 18, 2012 1:15 pm
by tomok
TM1 will not store alias values if the alias is the same as the element name. For example, if you try and create an alias value of "Acme" for an element called "Acme" TM1 will see that they are the same and not store the alias. You will not get any error messages, the value in the ElementAttributes cube will just be empty.

Re: ATTRS function

Posted: Mon Jun 18, 2012 1:27 pm
by Michel Zijlema
tomok wrote:TM1 will not store alias values if the alias is the same as the element name. For example, if you try and create an alias value of "Acme" for an element called "Acme" TM1 will see that they are the same and not store the alias. You will not get any error messages, the value in the ElementAttributes cube will just be empty.
This is only when you enter the alias value through the Attributes Editor. If you enter/load the value directly in the regarding attributes cube, the alias will be stored.

Michel