ATTRS - TIPS

Post Reply
Ppellerin
Posts: 2
Joined: Thu Jul 18, 2013 6:43 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2010

ATTRS - TIPS

Post by Ppellerin »

Hello

Before reading my question, please note I'm rather new to the TM1 world!

My question is about the ATTRS formula : this formula gives you a value for a certain attribute for a certain element of a dimension.

What I need is a formula/trick which would make the contrary : for a certain value of the attribute, get me back he corresponding element

Any ideas?

Thanks in advance for your answers
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS - TIPS

Post by declanr »

As a built in formula this is impossible for the simple fact that 2 elements could have the same attribute so it wouldn't know what to return in that instance.

However; if in your model it is always a 1 to 1 relationship between element and attribute, you could set up a TI that simply cycles through the dimension and creates a second lookup dimension where the attributes of your first dimension are actually the elements and that element has an attribute which would be the elements from the first dimension.

You could then perform your ATTRS against the second dimension.

Another solution if it truly is 1 to 1 would simply be to set it as an alias instead of an attribute.
Declan Rodger
Ppellerin
Posts: 2
Joined: Thu Jul 18, 2013 6:43 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2010

Re: ATTRS - TIPS

Post by Ppellerin »

Right, I was afraid that might be the main problem. Unfortunately, that's not a 1 to 1 relation between the element and the attribute.
Like you said, I might need to change the way my dimensions work. If I do have a problem with that, I'll post here again!

Thanks for your answer
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS - TIPS

Post by declanr »

Ppellerin wrote:Right, I was afraid that might be the main problem. Unfortunately, that's not a 1 to 1 relation between the element and the attribute.
Like you said, I might need to change the way my dimensions work. If I do have a problem with that, I'll post here again!

Thanks for your answer

Well taking in to account what I originally said, it's not actually the case that it needs to be 1 to 1 but it is the case that you will need to tell us the logic of what you want to pull back before we could point you in the right direction.


For example if your elements are products and your attributes were sales districts you could set up a TI to create your sales districts as a dimension and then loop through the products in a sales cube so that the "product" attribute of your "sales district" dimension would always return the product with the highest sales.

You could also set up a 2-d cube with 1 dimension being the sales districts and the other dimension being a counter (let's say up to 5) and populate it with all of the products (obviously you may need the counter to be more than 5) then use an nested IF statements along with your ATTRS to get a list of all relevant products.

Essentially TM1 will be capable of producing anything you want as long as their is logic behind it.
Declan Rodger
User avatar
garry cook
Community Contributor
Posts: 209
Joined: Thu May 22, 2008 7:45 am
OLAP Product: TM1
Version: Various
Excel Version: Various

Re: ATTRS - TIPS

Post by garry cook »

If you're trying to create a list (which I assume you are as one cell can't realistically hold multi entries), you could set up a simple active form with an MDX reference to a named cell on a sheet as the attribute name you're trying to get the list for.
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: ATTRS - TIPS

Post by Duncan P »

I remember a problem for which I created extra dimensions whose sole purpose was to hold many-to-many relationships between the C level elements, which represented one side of the relationship, and the N level elements which represented the other. I just used ELCOMPN and ELCOMP for one way and ELPARN and ELPAR for the other.
Post Reply