function to use for selecting element by attribute value
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
function to use for selecting element by attribute value
How can i select an element in a dimension with its numeic attribute value??? in Turbo Integrator Please help
Thanks
Vinnusea
Vinnusea
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: function to use for selecting element by attribute value
I am not really sure what you are trying to do (as you have not explained it here).
But you can get the Attribute value of an element by using the ATTRS() function in the TI process
But you can get the Attribute value of an element by using the ATTRS() function in the TI process
Cheers!
Rizwan Kaif
Rizwan Kaif
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: function to use for selecting element by attribute value
Hi
Yes i just need the element which matches the numeric attibute value..and i need to use this in Turbo integrator .
Any MDX or regular scripts /functions can help me???
Yes i just need the element which matches the numeric attibute value..and i need to use this in Turbo integrator .
Any MDX or regular scripts /functions can help me???
Thanks
Vinnusea
Vinnusea
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: function to use for selecting element by attribute value
As mentioned earlier that ATTRS() function is the one which you need. Here is the syntax for it:vinnusea wrote: Any MDX or regular scripts /functions can help me???
Code: Select all
ATTRS(dimension, element, attribute)
ATTRS('plan_business_unit', '10100', 'Currency')
Cheers!
Rizwan Kaif
Rizwan Kaif
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: function to use for selecting element by attribute value
So here the issue is
If i need a attribute value of period 01,2010 in period dimension
i would write as ATTRN(Period, !Period, Index Num) which give out some number example 117
But if i need something like this
Need Period Which matches the Index Num 117
then i must get 01-2010 out...
How can i get this???
Did i make my issue clear?
If i need a attribute value of period 01,2010 in period dimension
i would write as ATTRN(Period, !Period, Index Num) which give out some number example 117
But if i need something like this
Need Period Which matches the Index Num 117
then i must get 01-2010 out...
How can i get this???
Did i make my issue clear?
Thanks
Vinnusea
Vinnusea
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: function to use for selecting element by attribute value
The index number attribute you are referring to would have to be not just an attribute, but also an alias and it can't be a numeric attribute, it would have to be string. You can store digits in the attribute, it just has to be set up as a string attribute to qualify to be an alias.vinnusea wrote:So here the issue is
If i need a attribute value of period 01,2010 in period dimension
i would write as ATTRN(Period, !Period, Index Num) which give out some number example 117
But if i need something like this
Need Period Which matches the Index Num 117
then i must get 01-2010 out...
How can i get this???
Did i make my issue clear?
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: function to use for selecting element by attribute value
Use DimensionElementPrincipalName() in a TI Process to get the Element name of the attribute.vinnusea wrote:Need Period Which matches the Index Num 117
then i must get 01-2010 out...
Cheers!
Rizwan Kaif
Rizwan Kaif
-
- Site Admin
- Posts: 6667
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: function to use for selecting element by attribute value
That only works with aliases. This has been stated to be a numeric attribute.rkaif wrote:Use DimensionElementPrincipalName() in a TI Process to get the Element name of the attribute.vinnusea wrote:Need Period Which matches the Index Num 117
then i must get 01-2010 out...
Vinnusea, two options are:
(a) Add the Index Number as an alias, as per Tomok's suggestion. This will only work if the index number attributes are unique; or
(b) Get the size of the dimension using DimSiz then search through it using DimNm until you find the one that you're looking for.
Option (a) would be the preferred one if you have a choice.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: function to use for selecting element by attribute value
The OP is wanting to select elements by a numeric attribute value, this will not help.rkaif wrote:Use DimensionElementPrincipalName() in a TI Process to get the Element name of the attribute.
vinnusea - you can do what you want and quite easily. Use SubsetCreateByMDX to create a filtered subset of your dimension based on the numeric attribute value you are seeking a match for. Do this on the prolog and then you can use this subset in the rest of your process. an alternative would be to simply process subset ALL for the dimension and do an initial test for the value and itemskip if you don't find a match.
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: function to use for selecting element by attribute value
yes this works... Really appreciate for your time guys..
Thanks
Vinnusea
Vinnusea