Clear unwanted Data in order to Delete a Member


Hoping someone in the community might have a solution for this and is willing to share a snippet of code that will enable us to properly 'clear' any data (including zero) from a specific intersection so that we can delete a metadata member.

The DM step "Clear Data" is simply too all-encompassing to use in this case and we need to be more surgical in our approach.

Thanks in advance for any assistance.


Valued Contributor

Custom Calculate DM Set will call a Finance BR where you can surgically clear data intersections



New Contributor III

As mentioned above use a Finance rule with a data management job of custom calculate. In data management job, put in the cube, entity, time and scenario.

I've used this below, replace the 4100 with the account you're needing cleared in both lines. If you have more than one account use ex. "A#4100, A#4101". After each dimension you can put a comma if you're trying to clear out an even more specific intersection, Follow the intellisense as you type to see which dimension you're on. For example, if you're clearing out a specific U4 see the second example.

api.Data.Calculate("V#Periodic = V#Periodic * 0", "A#4100")
api.Data.ClearCalculatedData(True, True, True, True,"A#4100")

api.Data.Calculate("V#Periodic = V#Periodic * 0",,,,,,,,"U4#Pipeline")
api.Data.ClearCalculatedData(True, True, True, True,,,,,,,,"U4#Pipeline")


Then I usually go to the System - Database - Data Records and verify if the data is cleared out. There may be a better solution, but this is one a consultant had shown me and I've used it many times.