HierarchyElementExists checks whether an element exists in a dimension. If the element exists, the result is 1. If it does not exist, the result is 0.