Page 1 of 1

ATTRS in DB?

Posted: Tue Jun 25, 2013 7:30 pm
by Kazêh
hi, im new on tm1 and i have a doubt about if is it posible to have attrs under DB function like:

[]= S: if((DB(!dimension1,!dimension2,attrs('dimension3', !dimension3, 'Atribute'), !dimension4);

is it posible?

Thanks

Re: ATTRS in DB?

Posted: Tue Jun 25, 2013 7:42 pm
by declanr
Kazêh wrote:hi, im new on tm1 and i have a doubt about if is it posible to have attrs under DB function like:

[]= S: if((DB(!dimension1,!dimension2,attrs('dimension3', !dimension3, 'Atribute'), !dimension4);

is it posible?

Thanks
Kazêh,

It's perfectly possible to incorporate an ATTRS function within a DB and is in fact very common practice, you can include pretty much any function within any other function as long as it makes sense to do so (e.g. check that the output of the incorporated function is string if the requirement is for the parameter of the exterior function to be string)

Your best bet when looking at this sort of concept is to simply set up some basic dummy models (possibly one of the pre-packaged IBM ones) and just add the rule and see what happens,

Your above rule would obviously need a result to the IF statement and a cube reference e.g.

Code: Select all

['Measure']= S: If( DB('Cube', !dimension1,!dimension2, attrs('dimension3', !dimension3, 'Atribute'), !dimension4) = 1, 'True', 'False' );

Re: ATTRS in DB?

Posted: Tue Jun 25, 2013 7:44 pm
by Kazêh
thanks for the quick aswer, i will try it out :D