@Lotsaram
What I was getting at is that from what I have seen TI functions such as DimensionElementInsert operate on the Main Hierarchy, or the Default Hierarchy, what most of us think of as the traditional dimension, but of course, the idea of a traditional dimension goes as soon as you introduce a named hierarchy.
By comparison HierarchyElementInsert has the additional Hierarchy Name parameter and is designed to operate on a specific Named Hierarchy. You can however, make it operate on the Main Hier by making the Hierarchy Name parameter the same as the Dimension.
The same is true of DimensionElementComponentAdd and HierarchyElementComponentAdd
Interesting that DimensionElementDelete operates on Leaves. That does seem like a bug. However, it is not something I use in an automated process. We tend to explicitly delete base level elements because of the risk of losing data. Generally speaking if an element is there, then even if it isn't current, it will have some historical data on it. Even if it has never been used, there might be outstanding purchase orders, etc, so we are very cautious about deleting elements. Probably worth reporting to IBM though.
@MPetty
It might initially seem odd that you can have an element in the Leaves hierarchy that does not exist in any other hierarchy. That is due to the special place that the base level must have. The base level still needs to attach to the data in the cube. It is therefore the route by which any data will consolidate up into any of the hierarchies.
Many of us who have been developing for years will have traditional alternate hierarchies in the main hierarchy of the dimension. That meant that it was probably not the best place to start saying that this is where the common base level elements will be stored. If was at a greenfield site now, I might very well design a system where the main hier only had a simple roll up of the leaves and any other hierarchies were named hierarchies.
One role for the Main Hier is to act as the Default Hierarchy. This comes into play when you write an MDX query against a cube, and, if you don't specify all dimensions in the cube, MDX will want to know a Default Element in a Default Hierarchy to use to resolve the query against that dimension. The Default Hierarchy will be the Main Hierarchy. The Default Element will be given in the }HierarchyProperties cube.
If you look at the }HierarchyProperties cube now, you will see that as well as the Main Hier represented by the Dimension name, you also have Dimension:Hierarchy elements in the }Dimensions dimension. This allows you to name the levels in each of the Named Hierarchies.
Below is a link to an interview with Hubert Heijkers which covers this. The good looking one on the left is Alan Kirk
https://www.youtube.com/watch?v=tL3puB0AK74
Regards
Paul Simon