Page 1 of 1
Wierd attribute output
Posted: Thu Dec 06, 2012 10:19 am
by A.Pete
Hey
I have an attribute in a dimension called CompanyCode (see picture below). Im using a TI process to create a textfile where I send in the attribute Company Code to the dimension and want the HFMCompany from it (using the ATTRS function seen in the picture.)
But when I look in the file it just writes "Company Code" instead of the actual element... (also seen in the picture).
What am I doing wrong here??
/Peter
Re: Wierd attribute output
Posted: Thu Dec 06, 2012 11:30 am
by Duncan P
This normally happens when ATTRS is used in TI and either the element name or the attribute name is not found. In such cases there will normally be a minor error generated as well.
You are using trim(V14) as the element name in the ATTRS function call but you are not outputting it with ASCIIOutput. What does V14 contain?
Re: Wierd attribute output
Posted: Thu Dec 06, 2012 11:52 am
by A.Pete
Hi
V14 is the value from the source cube containing the value in Company Code attribute in the HFMCompany Dimension. I tried Trim(V14) to see if that did anything different but it didnt.
The source cube contains a company, I.e 4050, and I want get the corresponding company in the HFMCompany dimension, in this case MH4050 as the picture below. Thats why im using the ATTRS function but I cant get it to work for the company dimension. There are however more companies in the source cube company dimension than there are in the HFM company dimension. Could this be the issue?
Br
/Peter
Re: Wierd attribute output
Posted: Thu Dec 06, 2012 12:00 pm
by Duncan P
From what you are saying it appears you are expecting ATTRS to do "find me the dimension element that has the attribute value ...". What it actually does is "fetch me the attribute value for the dimension element ...".
You are looking for "4050" and the dimension element is "MH4050". It's not going to find it. Is it valid to use 'MH' | V14? Is the relationship that simple?
[EDIT]
Alternatively if V14 is from a dimension in the source cube then can you put the HFM account name as an attribute on the source account dimension?
Re: Wierd attribute output
Posted: Thu Dec 06, 2012 3:16 pm
by dr.nybble
This is now a logged defect in TM1 and will be fixed in an upcoming release. When an error occurs a minor error is logged but the ATTRS function does not clean up the stack properly so it returns the third argument to the function (the attribute name) rather than empty string.
Re: Wierd attribute output
Posted: Thu Dec 06, 2012 5:45 pm
by A.Pete
Thx for all your replies! I kinda solved it with the tips from you Duncan but the bug also made me understand this a bit more!!
Thx again
Peter