Alias doesn't work when using element list item


#1

I am trying to follow the deep dive and came across a problem. When I try to reference the alias of the element list item it doesn’t give the alias name instead will return the principle name.
So the below code will give me:


This:


#2

Hi @dwong,

Is your cache disabled? Check this article out.

If it is still the same, could you post the HTML part of the table involve with the above - and the code where you defined tm1-ui-element-list?


Paul


#3

Hi Paul,

Thanks for your reply. I have already disabled the cache. See below the code that defined tm1-ui-element-list

<tm1-ui-element-list
tm1-instance="dev"
tm1-dimension="Region"
tm1-subset="Default"
tm1-calculate-top-level="true"
ng-model="page.regions">
</tm1-ui-element-list>

David


#4

Hi @dwong,

Try this one out:

On your HTML page, try to check the value returned by the element-list. You can do so by typing: {{page.regions}}

So for example, you type on your HTML:

Check the results if it has the attributes that you were looking for (if it is only less than 10Kb when saved into a file, could you attached it here). If not, check the subset in TM1 first, and just verify that you had Alias set on that subset.


Paul


#5

Hi Paul,

I tried the code you suggested and seems like the alias is not in the regions, below is part of the code returned:

[{“key”:“1”,“level”:3,“topLevel”:0,“index”:1,“type”:“C”,“isLeaf”:false,“topLevelClass”:“tm1-ui-level-0”,“NS”:1721228.847,“OE”:159367.5700000002},{“key”:“13”,“level”:0,“topLevel”:0,“index”:3,“type”:“N”,“isLeaf”:true,“topLevelClass”:“tm1-ui-level-N”,“NS”:74711.19000000009,“OE”:0},

I have checked the default subset does have alias turned on:

David


#6

Hi @dwong,

Looking at the returned value, I noticed that it has properties OE and NS.

Perhaps you are referring to a different TM1 instance? The current Canvas_Sample instance does not have those attributes.

Can you check your Configuration page and verify that your ‘dev’ instance is pointing to Canvas_Sample? Also, any idea which instance / dimension do you have an OE and NS attributes?


Paul


#7

Hi Paul,

The NS and OE are coming from the value i specific as I was going through the exercise. See below for the code for them. I only have one instance which is the canvas_sample on the server.

<tm1-ui-dbr
tm1-instance="dev"
tm1-cube="General Ledger"
tm1-elements='"Actual","2015/16",{{page.titles.month}},"Local",{{region.key}},{{page.titles.Department}},"Net Sales","Amount"'
tm1-data-decimal="0"
ng-model="region.NS">
</tm1-ui-dbr>
                         
<tm1-ui-dbr
tm1-instance="dev"
tm1-cube="General Ledger"
tm1-elements='"Actual","2015/16",{{page.titles.month}},"Local",{{region.key}},{{page.titles.Department}},"Operating Expenses","Amount"'
tm1-data-decimal="0"
ng-model="region.OE">
</tm1-ui-dbr>

Thanks.

David


#8

Hi @dwong,

Could you attached in here your whole HTML page? Thanks.


Paul


#9

Hi @dwong,

What is your TM1 version?

Canvas requires minimum of TM1 10.2 FP4. There were some bugs in the TM1 REST API which have been fixed with FP4.

If you try the following code:

<tm1-ui-element-list
	tm1-instance="dev"
	tm1-dimension="Region"
	tm1-subset="Default"
	tm1-calculate-top-level="true"
	ng-model="page.regions">
</tm1-ui-element-list>

{{page.regions}}

You should see the alias as a property:

But the subset has to be saved with alias ticked:

If the subset is not ticked,

you won’t be able to see the alias as property:

Could you try with an other subset or another dimension to see if you have the same issue.

Cheers,


#10

Hi Vincent,

I think i am on 10.2.2 Base. Let me try to update the FP and see if it fixes the problem. Thanks.

Regards,

David