OS metadata

fc
New Contributor III

Hi everyone,

I have a question related to the upload of a new dimension hierarchy through an XML file.

I currently have a file excel with the whole hierarchy for each dimension that I keep updating based on my client requests. 
I noticed that when I upload the file, the system merges the current version of the hierarchy with the previous one. This does not work for me because I would need the old hierarchy to be replaced by the new one. 

A possible solution could be to manually delete the hierarchy members before the upload of the new hierarchy, but this would delete the data that has been loaded already. I would need a solution to just overwrite the current relationships between the members of the hierarchy without deleting them. 

Is there a way to do that?

Thanks in advance!

1 ACCEPTED SOLUTION

drgerrow
New Contributor III

@fc You can setup the xml's Relationships section to "Delete" a Relationship like this:

<relationships>

  <relationship parent="{parent name}" child="{child name}" action="Delete" />

</relationships>

 

Note that deleting the Relationships may result in Orphaning a member, which in your case is what you want.  A member that is Orphaned does not lose/delete its data, so as long as you upload your new file and re-create the new Relationships, your overall data will be unaffected.

Darryl Gerrow, CFO Solutions LLC

View solution in original post

4 REPLIES 4

sudarshan
New Contributor III

Hi,

We have a similar use case where we require the hierarchy of a UD to be replaced and not merged. We go with the approach of "Break and Build" using xml to completely replace the existing hierarchy with the new one.

First create a break xml for the metadata by choosing the dimension and removing all relationships so everything gets orphaned and then for the build xml you just need to take an xml extract of the new hierarchy for all the members. Then the hierarchy is built again from scratch, thus replacing with the new structure. Though you do need to careful, as if they are any missed members they would remain orphaned. 

Thanks,

Sudarshan

fc
New Contributor III

What do you mean with "create a break xml"? Is there a fast way to remove all the current relationships in the hierarchy?

drgerrow
New Contributor III

@fc You can setup the xml's Relationships section to "Delete" a Relationship like this:

<relationships>

  <relationship parent="{parent name}" child="{child name}" action="Delete" />

</relationships>

 

Note that deleting the Relationships may result in Orphaning a member, which in your case is what you want.  A member that is Orphaned does not lose/delete its data, so as long as you upload your new file and re-create the new Relationships, your overall data will be unaffected.

Darryl Gerrow, CFO Solutions LLC

AdamB
New Contributor II

@fc Referring to what @drgerrow said above.... If you are savvy with VBA, I wrote this function to help myself quickly create the lines of xml code for deleting relationships by referencing the parent and child in the formula. You will just need to get the list of relationships in excel which could be done by extracting out the xml and parse using text to columns in excel.

Here is the code I use for generating the xml lines:

 

Public Function Remove_Relationships_XML(ParentName As String, ChildName As String) As String

Dim Line As String
Line = Line & "<relationship parent=""" & (ParentName) & """ child=""" & (ChildName) & """ action=""Delete"" />"
Remove_Relationships_XML = Line

Exit Function
End Function