Display Attribute value in MDX expression

Post Reply
aravind.cgns
Posts: 51
Joined: Sun Sep 11, 2016 1:55 pm
OLAP Product: Cognos Tm1
Version: 10.2,11
Excel Version: 2007

Display Attribute value in MDX expression

Post 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)}
MarenC
Regular Participant
Posts: 436
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: Display Attribute value in MDX expression

Post by MarenC »

Is the attribute an alias?

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

Maren
aravind.cgns
Posts: 51
Joined: Sun Sep 11, 2016 1:55 pm
OLAP Product: Cognos Tm1
Version: 10.2,11
Excel Version: 2007

Re: Display Attribute value in MDX expression

Post 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
lotsaram
MVP
Posts: 3703
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Display Attribute value in MDX expression

Post 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).
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
aravind.cgns
Posts: 51
Joined: Sun Sep 11, 2016 1:55 pm
OLAP Product: Cognos Tm1
Version: 10.2,11
Excel Version: 2007

Re: Display Attribute value in MDX expression

Post 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
Post Reply