Page 1 of 1
AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Wed Nov 27, 2013 11:42 am
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!
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Wed Nov 27, 2013 12:42 pm
by Gabor
CELLGETS returns a blank field for an Alias not set for a particular element. ATTRS refers back to principal element.
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Fri Nov 29, 2013 10:09 am
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.
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Fri Nov 29, 2013 11:10 am
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
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Fri Nov 29, 2013 6:03 pm
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.
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Sat Nov 30, 2013 1:24 pm
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.
Re: AttrS versus CellGetS from }ElementAttributes_ cube
Posted: Wed Dec 04, 2013 9:36 am
by sachin
This thread has given insight into the working of Aliases, which I was not aware of! Thanks all.