Page 1 of 1

Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 5:53 pm
by tm123
Hi,

I am trying to localize the dimension element names by creating an attribute called caption and populating it with ATTRPUTS Ti function ( for the selected language ), basically Im trying to figure out a way to create a default display type of Alias so every time you click the dimension in TM1Web, it shows the "Caption" instead of element code.

Here is the code I am using

myDim = 'Month' ;
AttrInsert(myDim, '', 'Caption', 'A');

AttrPutS('January', myDim, 'M1', 'Caption', 'en');
AttrPutS('February', myDim, 'M2', 'Caption', 'en');
AttrPutS('March', myDim, 'M3', 'Caption', 'en');

AttrPutS('Janvier', myDim, 'M1', 'Caption', 'fr');
AttrPutS('Fevrier', myDim, 'M2', 'Caption', 'fr');
AttrPutS('Mars', myDim, 'M3', 'Caption', 'fr');


I can run the code with no errors, and also I can see that it creates and populates the cube }LocalizedElementAttributes_Month as expected

I have a cube that uses month dimension, and when I connect to TM1Web and double click on my cube name, it brings the default view ( as expected ) but when I click on Dimension Month, I see element names ( M1, M2, M3 ), not the English Values for caption attribute

AM I missing something here?

Thanks

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 6:10 pm
by jim wood
It needs to be an alias. Are you sure you created it as an alias?

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 6:25 pm
by tm123
It is an Alias, and I can see it in the list of Aliases in the subset editor, and yes If I manually turn the Caption Alias ON, it shows the values. But I thought this should show automatically, otherwise, what is the difference from a regular alias?

Thanks

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 6:40 pm
by tomok
tm123 wrote:I have a cube that uses month dimension, and when I connect to TM1Web and double click on my cube name, it brings the default view ( as expected ) but when I click on Dimension Month, I see element names ( M1, M2, M3 ), not the English Values for caption attribute
Cube views don't automatically default to using an alias for dimensions unless you specifically set that. Does the default view you talk about above have the Month dimension set to use the alias instead of the dimension elements?

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 7:01 pm
by tm123
It does not, and that's what I am trying, to avoid users see the element codes since they have no meaning to them, instead I am trying to use this Caption Alias, which in all other cases ( for Cube Names and Dimension Names ) is applied automatically, so if there is a Caption Attribute defined for a cube name, that is the name it shows in TM1Web for that cube. I am sure I had asked this question to IBM when this new thing was introduced, and they told me that will be the default display name for the elements in all the clients that support that. So If the user has to select that manually, than this is no different from traditional Alias toggle and I don't see much value in this, but probably I am missing something, some place somewhere to tell the system to show Caption Alias by default, same thing as in Cognos BI/FM/Report Studio

Thanks anyways

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 7:08 pm
by tomok
tm123 wrote:It does not, and that's what I am trying, to avoid users see the element codes since they have no meaning to them, instead I am trying to use this Caption Alias, which in all other cases ( for Cube Names and Dimension Names ) is applied automatically, so if there is a Caption Attribute defined for a cube name, that is the name it shows in TM1Web for that cube.
What the Caption thing does is automatically pick the language for you based on the browser setting. Since cubes and dimensions don't really have attributes, using the caption just automatically switches their name to the appropriate language. Since elements can have multiple attributes and aliases, it is up to you to pick the "Caption" attribute for the specific cube view. Then TM1 will automatically choose which language to display.

Re: Localization of Dimension Elements with Caption Attribute

Posted: Thu Aug 20, 2015 8:15 pm
by Duncan P
The other thing about the new caption capability is that you can use any text attribute. It doesn't have to be an alias. This means that you can have multiple items with the same caption. So if you have France->Paris and Texas->Paris you can call both the leaves Paris.

Re: Localization of Dimension Elements with Caption Attribute

Posted: Fri Aug 21, 2015 12:45 pm
by tm123
Thank you guys,

Regarding 'Caption' attribute, I thought also that it can be also String type attribute and then it can be used as a Display in TM1Web. I can create it as caption attribute and I can see it in the cube }LocalizedElementAttributes_Month, but I cant see how I can use it as a display. Even when I try to use the "Filter by Attribute", the attribute name "Caption" shows in the list, but no values show for it, so that tells me that there must be something I'm missing :)