charan wrote:please any suggestions
Only patience. It's two days before Christmas, a time which is often mandatory annual leave, and it's a Sunday to boot. I doubt that many people are spending a lot of time in places like this at the moment. I've also got a stack of seasonal e-mails that I have to reply to and at this time of the year I doubt that I'm the only one.
charan wrote:
Thank you. There is no dimension Test_channel created before on this server, this is the first time I am creating.
All I can tell you is that the error message that you got is one that you get when the dimension already exists.
charan wrote:So, for creating a new dimension, I have to write scripts like in Prolog tab,
DImension exists.
Dimension create.
DImensionElementInsert.
That may be what you read but it's at more than a little variance with what I wrote.
You need to go back to the basics.
What does the Prolog tab do? It runs the code on that tab once, before any rows of your data file are processed. In this case it runs before any lines of your channles.csv (as you've typed it) file are read.
So yes, you can create the dimension in there. However you should re-read the exact code that I posted; you check whether the dimension exists and only create it if you confirm that it doesn't.
You can also insert elements (both N level and consolidations) into the dimension (using DimensionElementInsert) on this tab.
However the element names must be ones that you already know; they can't be from your .csv file because that hasn't been read at that point.
You can also update consolidations via DimensionElementComponentAdd and DimensionElementComponentDelete on this tab but again, you can only do it if you know the names of the elements.
Now what does the Metadata tab do?
It reads your source file line by line. You use the values in each line to update the metadata on your server, such as by creating elements or updating consolidations.
Again, to insert elements you can use DimensionElementInsert but
this time instead of using fixed names you can use the names that appear on the rows of the file.
In most cases when doing this kind of update you'll have at least two columns; one telling you the name of the child element, and one telling you the name of the parent element.
In other words it might look like this:
Code: Select all
Row No Child Parent Consolidation
1 Germany Central Europe
2 Poland Central Europe
3 Central Europe Europe
4 USA North America
Child would be one variable, Parent Consolidation would be the other.
To put the child under the consolidation, you just use the DimensionElementComponentAdd function.
When all of the rows of your file have been read then the metadata (dimensions) are updated and you have the updated dimension on the server.
So let's look at your question in the light of that.
charan wrote:Here I have one doubt, If my dimension contains One consolidated element with N number of leaf elements how to write script for it.
If you mean that you have one consolidation with all of the elements your data file under it then:
- You can create the consolidation element in either the Prolog or the Metadata tab, but it's probably more efficient to do it in the Prolog tab); and
- Use the DimensionElementComponentAdd function on the Metadata tab to add the element named on each row of your data file to that consolidation.
charan wrote:If I has N levels of consolidated elements with the leaf elements how wirte script for it(this scripts to be written in metadata tab?).
Not sure I follow this bit. If you mean "how do I create a hierarchy" then as long as your source file has both parent and child elements (as per the example above) then the hierarchy is automatically created as you do the DimensionElementComponentAdds.