Page 1 of 1

ATTRN in other cube

Posted: Thu May 15, 2014 9:55 am
by Wirt
hello everyone

please explain to me why we can not use the ATTRN in the link for another cube, for example:

= N: IF ( ATTRN('Dim_X',!Dim_X,'Num') = ATTRN ( 'Dim_Y', !Dim_Y, 'Num1'),

DB('Cube1',!Dim1, Dim2, ATTRN('Dim3',!Dim3,'Num')), DB('Cube2',!Dim4, Dim5, ATTRN('Dim6',!Dim6,'Num'));

gives an error when I save

thank you

Re: ATTRN in other cube

Posted: Thu May 15, 2014 10:03 am
by David Usherwood
It's failing because attrn() returns a number and dimension references need to be strings.

Re: ATTRN in other cube

Posted: Thu May 15, 2014 10:20 am
by Wirt
You mean that if in the link is present ATTRN, all elements of dim. should be string?

Re: ATTRN in other cube

Posted: Thu May 15, 2014 12:13 pm
by tomok
What he is telling you is that the DB function requires strings for all its arguments and you are using ATTRN as some of those arguments and that function returns numbers. Convert them to string using the STR function.

Re: ATTRN in other cube

Posted: Thu May 15, 2014 12:27 pm
by jim wood
Wirt,

Think about it. If you build a TI all the element variables have to be string. You may able to store numbers against them but all element names are strings, how else would you mix numbers and text so freely when creating elements?

Jim.