ATTRS function

Post Reply
User avatar
rahul1tm1
Posts: 5
Joined: Wed Mar 14, 2012 4:07 pm
OLAP Product: Cognos TM1
Version: 9.5.1
Excel Version: 2003 2007
Location: Portland, OR, USA

ATTRS function

Post 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;

Best Regards,
Rahul
User avatar
Olivier
Community Contributor
Posts: 159
Joined: Thu Jun 26, 2008 5:46 am
OLAP Product: TM1
Version: Tm1 10.2.2fp4 -> 2.09
Excel Version: Excel 2013 - 2019
Location: Sydney

Re: ATTRS function

Post 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,
HTH
Olivier
User avatar
rahul1tm1
Posts: 5
Joined: Wed Mar 14, 2012 4:07 pm
OLAP Product: Cognos TM1
Version: 9.5.1
Excel Version: 2003 2007
Location: Portland, OR, USA

Re: ATTRS function

Post 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.
Best Regards,
Rahul
User avatar
Michel Zijlema
Site Admin
Posts: 713
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: ATTRS function

Post 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
User avatar
Olivier
Community Contributor
Posts: 159
Joined: Thu Jun 26, 2008 5:46 am
OLAP Product: TM1
Version: Tm1 10.2.2fp4 -> 2.09
Excel Version: Excel 2013 - 2019
Location: Sydney

Re: ATTRS function

Post 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 ;)
HTH
Olivier
User avatar
rahul1tm1
Posts: 5
Joined: Wed Mar 14, 2012 4:07 pm
OLAP Product: Cognos TM1
Version: 9.5.1
Excel Version: 2003 2007
Location: Portland, OR, USA

Re: ATTRS function

Post 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!
Best Regards,
Rahul
User avatar
Michel Zijlema
Site Admin
Posts: 713
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: ATTRS function

Post 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
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: ATTRS function

Post 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.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
Michel Zijlema
Site Admin
Posts: 713
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: ATTRS function

Post 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
Post Reply