Concatenating element name and attribute value in rules

Post Reply
vasek1192
Posts: 47
Joined: Sun Jan 24, 2021 5:55 pm
OLAP Product: IBM Planning analytics
Version: 2.0.9.3
Excel Version: 2019

Concatenating element name and attribute value in rules

Post by vasek1192 »

Hi, I was wondering if it is possible to concatenate Element names and Attribute values using rules?

Example:
Concatenating.jpg
Concatenating.jpg (21.67 KiB) Viewed 4023 times

I would like to get text value : "PF - Car Manufacturing" in the alias attribute Plny_nazev.

I serached through the IBM documentation and oth this forum, but cant find combination of functions that would work. any suggestions? Thanks
User avatar
Elessar
Community Contributor
Posts: 358
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: Concatenating element name and attribute value in rules

Post by Elessar »

Hi!

Code: Select all

'a' | 'b'
Interesting! I've tried to find it in "TM1 Reference", and didn't find it either...
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 7th article - Development requirements.
User avatar
Alan Kirk
Site Admin
Posts: 6610
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Concatenating element name and attribute value in rules

Post by Alan Kirk »

AttrS will retrieve a string attribute in a rule. I would expect this to work to populate another String attribute (I've never tried it) but I'm not at all sure that a rule will (or should) work to populate an alias. The problem is that an alias needs to be a unique identifier across the principal names and all other aliases, and if it's rules generated then there is no guarantee that you won't run into conflicts. When you update a dimension with the relevant functions, the server does a validation on that. If the aliases were to be dependent on other inputs, the server can't do that.

This is not to say that it won't work; I've never tried it and to be honest it's not something I would ever do in a production environment anyway for the reason specified above.

In a case like this I'd write a TI process to update the alias after each update of the dimension. I doubt that the dimension would be updated often enough to really NEED real time calculation for this.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
ascheevel
Community Contributor
Posts: 288
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: Concatenating element name and attribute value in rules

Post by ascheevel »

You can use a rule to populate an alias in an attributes cube. We've done it to populate an alias on a product dimension where the caption is the concatenation of the SKU ID and item description attributes. As Alan says, things will get messy if you inadvertently have a rule evaluating to the same alias for 2 separate elements. When that happens, you will see an error in the server log like "Alias...for element...is invalid and has been set to blank". As far as I know, that would be the only indication that you have an alias conflict; you don't get the hand-to-forehead slap you would if manually entering a duplicate alias in the attributes editor. If you do decide to use a rule, I would say heed Alan's cautions and only use a concatenation rule to define an alias if you're absolutely certain that there won't be a conflict. If you can't be 100% certain and still want to implement, you can test for duplicate aliases with a TI process. You would spin through each element in the dimension comparing the index number of each element to the index of the specified alias for the original element.
Post Reply