Page 1 of 1

ATTRS - TIPS

Posted: Thu Jul 18, 2013 7:19 pm
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

Re: ATTRS - TIPS

Posted: Thu Jul 18, 2013 7:24 pm
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.

Re: ATTRS - TIPS

Posted: Thu Jul 18, 2013 7:44 pm
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

Re: ATTRS - TIPS

Posted: Thu Jul 18, 2013 7:57 pm
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.

Re: ATTRS - TIPS

Posted: Thu Jul 18, 2013 8:03 pm
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.

Re: ATTRS - TIPS

Posted: Thu Jul 18, 2013 8:49 pm
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.