Page 1 of 1

Display Attribute value in MDX expression

Posted: Mon Oct 25, 2021 8:52 am
by aravind.cgns
Hi All,

I am using a MDX expression to pull current year from a lookup cube in subset. The values retrieved are native elements and are in fiscal year format, Quarter dimension has a calendar year attribute(CY Year) to display elements in CY format. Tried to use CurrentMember.Properties function but it didn't work, is there a way to display elements CY format using attribute CY Year in MDX expression?

MDX :

{STRTOMEMBER("[Quarter].[Quarter].[" + [Lookup Cube].([Comment].[Comment],[Description].[Current Quarter]) + "]").LAG(1) : STRTOMEMBER("[Quarter].[Quarter].[" + [Lookup Cube].([Comment].[Comment],[Description].[Current Quarter]) + "]").LEAD(20)}

Re: Display Attribute value in MDX expression

Posted: Mon Oct 25, 2021 8:58 am
by MarenC
Is the attribute an alias?

If so why don't you just switch on the alias?

Maren

Re: Display Attribute value in MDX expression

Posted: Mon Oct 25, 2021 9:03 am
by aravind.cgns
Hi Maren,

Thanks for the response, Yes attribute is a alias. I can turn it on works fine in TM1. I am actually trying to read view via REST API which only pulls native elements though i save my view with Alias turned on in the view. Looking for an option to turn on alias within MDX expression..

Thanks,
Arvind

Re: Display Attribute value in MDX expression

Posted: Mon Oct 25, 2021 12:49 pm
by lotsaram
The Rest API will always return the principal member name under the object. However if you also request member properties then these will also be returned in the JSON under the attributes associated with the member. It is then up to whichever front end you are using to display either the member name, unique name or attribute(s).

Re: Display Attribute value in MDX expression

Posted: Mon Oct 25, 2021 1:15 pm
by aravind.cgns
Thank a lot Lotsaram!!

I was able to retrieve the names , attributes by specifying it in tuple members. This has fixed my issue :D