AttrS versus CellGetS from }ElementAttributes_ cube

Post Reply
User avatar
sachin
Posts: 92
Joined: Fri Jan 15, 2010 9:54 pm
OLAP Product: Transformer,SSAS, EP, TM1
Version: 7.3 2005 10.1 10.1.1
Excel Version: 2013
Contact:

AttrS versus CellGetS from }ElementAttributes_ cube

Post by sachin »

In an application that I am inheriting, I see in almost every TI use of

Code: Select all

CellGetS ('}ElementAttributes_Dim_Name', element1, element2)
While we have always been using

Code: Select all

 AttrS ('Dim_Name', element1, element2) 
... where element2 is the attribute name we are interested in. The processes in question are used for data load into TM1 cubes.

To summarize, the approach used to get an element's attribute involves going to the control cube and getting the value. While we have traditionally been using built-in function of AttrS or AttrN to get the value.

Is there an advantage of one over the other, be it in terms of maintenance or performance or locking etc? I can't think of any; however, I am curious to hear how others weigh on this usage.

Thanks much!
Check out my blog for some good information on TM1, SPSS
Gabor
MVP
Posts: 170
Joined: Fri Dec 10, 2010 4:07 pm
OLAP Product: TM1
Version: [2.x ...] 11.x / PAL 2.0.9
Excel Version: Excel 2013-2016
Location: Germany

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by Gabor »

CELLGETS returns a blank field for an Alias not set for a particular element. ATTRS refers back to principal element.
User avatar
sachin
Posts: 92
Joined: Fri Jan 15, 2010 9:54 pm
OLAP Product: Transformer,SSAS, EP, TM1
Version: 7.3 2005 10.1 10.1.1
Excel Version: 2013
Contact:

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by sachin »

Thank you Gabor for your reply. Since I haven't heard from others, I believe working with either of the approaches should be just fine.

I tested your scenario. It looks like I get blank with either of those approaches i.e. Created an alias attribute on a dim, but did not populate it. Using AttrS or CellGetS from the ElementAttributes cube both returned blank! We are on 10.1.1.
Check out my blog for some good information on TM1, SPSS
Gabor
MVP
Posts: 170
Joined: Fri Dec 10, 2010 4:07 pm
OLAP Product: TM1
Version: [2.x ...] 11.x / PAL 2.0.9
Excel Version: Excel 2013-2016
Location: Germany

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by Gabor »

Good to give me this hint, I have retested it and you are right.
I was sure, I saw the other behavior when aliases were introduced to TM1 and also with some later versions. But maybe I have simply stored the wrong information in my "memory".
Regards
Gabor
Wim Gielis
MVP
Posts: 3235
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by Wim Gielis »

Hello,

I wrote about it here:
http://users.skynet.be/fa436118/wim/tm1 ... ias_EN.htm

(At least) in that version, the attributes cube was empty too.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
buncikp
Posts: 16
Joined: Tue Feb 12, 2013 7:31 am
OLAP Product: TM1+Cognos Express
Version: 9.5.2+10.1+10.2
Excel Version: 2007+2010
Location: Prague

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by buncikp »

It's good to be aware of this as some MDX functions might be affected as well - for example ORDER function in MDX is not picking up aliases "populated" by default. The point is that TM1 engine uses element principal name whenever alias value for that element is technically empty in given }ElementAttributes cube, but some functions - as CellGets or MDX as above will not do this substitution.
User avatar
sachin
Posts: 92
Joined: Fri Jan 15, 2010 9:54 pm
OLAP Product: Transformer,SSAS, EP, TM1
Version: 7.3 2005 10.1 10.1.1
Excel Version: 2013
Contact:

Re: AttrS versus CellGetS from }ElementAttributes_ cube

Post by sachin »

This thread has given insight into the working of Aliases, which I was not aware of! Thanks all.
Check out my blog for some good information on TM1, SPSS
Post Reply