Page 1 of 1
Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 10:55 am
by wigglyrat
Hi -
Is this ever possible and if so why not?
Many thanks in advance.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 10:59 am
by babytiger
Have you tried? I am interested to know if you have.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 11:04 am
by wigglyrat
Yes and it does not work.
But I cannot seem to find anything on either the forum or developer guide explaining why?
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 11:06 am
by declanr
Yes you can; that's why it doesn't get special mention in any of the guides - all elements are treated equally in this respect.
Open the }ElementAttributes cube and you will have an easier to view screen than the right click rubbish.
EDIT - Out of interest when you say "It doesn't work"; what made you think that? Is it the subset editor? When you highlight a C-Level element in the subset editor - the properties window just shows its children and their attributes but despite it not showing you the consol's attributes it does still have them.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 11:31 am
by babytiger
Unless there is rule applied to the attribute you are trying to update, or that you don't have edit access. I can not understand why you weren't able update attributes on c levels.
Either way, it is a simple test to find out.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 11:45 am
by wigglyrat
Hi - we are not doing it manually but via TI.

- Capture.PNG (12.59 KiB) Viewed 9775 times
It adds it for 'Agency Number' which is N-level but not for the others - 'Head Office', 'Division', etc., which are consolidated elements.
Above is the code in the 'Data' section of the TI.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 11:49 am
by gtonkin
Is your attribute an alias or text? If an alias, does the TI finish successfully? If not, have you check the logs? Are you trying to assign duplicate aliases (same vSegmentation across multiple elements)?
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 2:33 pm
by wigglyrat
Hello:
Neither are aliases, it is trying to assign the same text value to everything in the elements' hierarchy.
Many thanks in advance.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 2:54 pm
by tomok
Can you go to the }ElementAttributes cube for that dimension and type in the values for the elements and attributes in question? If yes then you're TI process function is not working as you intended. I can confirm with 100% certainty that you CAN assign attributes to C level elements.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 3:11 pm
by wigglyrat
Yes. I am able to type in attributes manually for these, however the TI does work for the N Level in the code above - the first one 'vAgencyNumber' but not the others.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 3:44 pm
by gtonkin
Are you sure that the variables you are using contain the right elements you are trying to update?
May be helpful to asciioutput each of the variables list in the AttrPutS statements after the vAgencyNumber and see where TI is trying to send the attribute values.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 5:48 pm
by tomok
wigglyrat wrote:Yes. I am able to type in attributes manually for these, however the TI does work for the N Level in the code above - the first one 'vAgencyNumber' but not the others.
You do realize that vAgencyNumber is just a variable name, not a value. It's a value when it is assigned a value in your code or assigned a value from your input source. Where is the value stored in vHeadOffice_ICEref coming from? Are you sure it's not empty or pointing to the wrong element. You need to put an ASCIIOutput statement in your code to write the values from all your variables into a file so you can see what's in there at run time. It's really the only way to debug TI processes.
Re: Can you add attributes to C level elements?
Posted: Fri Mar 11, 2016 5:53 pm
by Alan Kirk
wigglyrat wrote:Yes. I am able to type in attributes manually for these, however the TI does work for the N Level in the code above - the first one 'vAgencyNumber' but not the others.
If I had to bet it's that either:
(a) Your code is not doing what you think it is; eg there may be something in your code that is causing it to skip the consolidations, which is why the
RFA guidelines request the
complete code; or, equally likely
(b) Your data source does not include the consolidation elements, meaning that the write action never occurs in the first place.
Re: Can you add attributes to C level elements?
Posted: Mon Mar 14, 2016 12:00 pm
by wigglyrat
HI Thanks for your replies.
Trying ASCII output proved it was adding the correct variable to the right element, thank you for this suggestion.
This code above however, was initially in the 'Data' tab. Moving it to 'metadata' has solved the issue and now the attributes have been added.
Can anyone please explain why moving it here would make a difference?
Many thanks.
Re: Can you add attributes to C level elements?
Posted: Mon Mar 14, 2016 12:56 pm
by qml
wigglyrat wrote:This code above however, was initially in the 'Data' tab. Moving it to 'metadata' has solved the issue and now the attributes have been added.
Can anyone please explain why moving it here would make a difference?
Do you mean
just the code you're showing us, or also some other code that goes with it?
AttrPutS is a data manipulation function, so can be used on any tab of the TI process. It is typically used on the Data tab because that ensures that the changes to the dimension are committed after the Metadata tab and all the required elements are in the dimension when you're trying to populate their attributes.
Re: Can you add attributes to C level elements?
Posted: Mon Mar 14, 2016 7:04 pm
by babytiger
The chances are that there is operation ( prior to at attrPutS ) in your data tab that has skipped over the attrPutS.
While leaving in metadata tab may work for now, it is not recommended. Depending what you are doing in your prolog and metadata tabs, this can cause potentially issues further down the track.