TM1 API get attribute values

Post Reply
aking
Posts: 32
Joined: Mon Oct 18, 2010 8:45 pm
OLAP Product: Cognos TM1
Version: 10.2.2
Excel Version: 365

TM1 API get attribute values

Post by aking »

I'm trying to interface with TM1 through the API. I have a dimension from which I am trying to read the values in the attributes for elements. I can get a handle to the dimension and the elements fine, but if I do something like this:

Code: Select all

hPriorityAttr = TM1ObjectListHandleByNameGet(hPool, hDimension, TM1ObjectAttributes(), TM1ValString(hPool, "Priority", 8))
Debug.print TM1ValType(hUser, hPriorityAttry)
Debug prints out an error. The error is:
ObjectListIsEmpty (Or something along those lines)

My guess is I shouldn't be using the TM1ObjectAttributes(), but one of the other property list...doodads. Can Anyone point me in the right direction?
User avatar
Mike Cowie
Site Admin
Posts: 484
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: TM1 API get attribute values

Post by Mike Cowie »

Hi:

Your current code is trying to get the attributes of a dimension, not the attributes of elements of the dimension. Try instead passing in a handle to one element from your dimension and you should get the handle to the attribute you're looking for.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
aking
Posts: 32
Joined: Mon Oct 18, 2010 8:45 pm
OLAP Product: Cognos TM1
Version: 10.2.2
Excel Version: 365

Re: TM1 API get attribute values

Post by aking »

Thanks, that did the trick.
Post Reply