IMetricSetServiceAddReplaceHierarchy Method  | 
 
            Adds or replaces a 
HierarchyUsage element to the metric set and saves it. It promotes the implicit hierarchy to the specified external hierarchy and sets the rendered top level.
            
 
    Namespace: 
   Dundas.BI.Entities.MetricSets
    Assembly:
   Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (25.3.0.1000)
SyntaxHierarchyUsage AddReplaceHierarchy(
	MetricSet metricSet,
	Guid elementParentId,
	string elementName,
	PlacementPosition placement,
	Guid hierarchyParentId,
	string hierarchyUniqueName,
	string levelUniqueName,
	bool retainAllElements = false
)
Function AddReplaceHierarchy ( 
	metricSet As MetricSet,
	elementParentId As Guid,
	elementName As String,
	placement As PlacementPosition,
	hierarchyParentId As Guid,
	hierarchyUniqueName As String,
	levelUniqueName As String,
	Optional retainAllElements As Boolean = false
) As HierarchyUsage
HierarchyUsage^ AddReplaceHierarchy(
	MetricSet^ metricSet, 
	Guid elementParentId, 
	String^ elementName, 
	PlacementPosition placement, 
	Guid hierarchyParentId, 
	String^ hierarchyUniqueName, 
	String^ levelUniqueName, 
	bool retainAllElements = false
)
abstract AddReplaceHierarchy : 
        metricSet : MetricSet * 
        elementParentId : Guid * 
        elementName : string * 
        placement : PlacementPosition * 
        hierarchyParentId : Guid * 
        hierarchyUniqueName : string * 
        levelUniqueName : string * 
        ?retainAllElements : bool 
(* Defaults:
        let _retainAllElements = defaultArg retainAllElements false
*)
-> HierarchyUsage 
Parameters
- metricSet
 - Type: Dundas.BI.Entities.MetricSetsMetricSet
The metric set. - elementParentId
 - Type: SystemGuid
The parent entity ID for the element to be added. - elementName
 - Type: SystemString
The name of the element (column/measure/hierarchy) to add. - placement
 - Type: Dundas.BI.Entities.MetricSetsPlacementPosition
The element placement position. - hierarchyParentId
 - Type: SystemGuid
The external hierarchy parent ID. - hierarchyUniqueName
 - Type: SystemString
The unique name of the external hierarchy. - levelUniqueName
 - Type: SystemString
The unique name of the hierarchy level. - retainAllElements (Optional)
 - Type: SystemBoolean
Gets or sets a value which will ensure all elements will be available if an automatic join occurs. 
Return Value
Type: 
HierarchyUsageThe hierarchy usage element.
Exceptions| Exception | Condition | 
|---|
| ArgumentException | elementParentId or hierarchyParentId is Empty
            or
            elementName is not a valid non-empty string
            or
             placement is not a PlacementPosition valid value
            or
            elementParentId references an object that could not be found or an object that is invalid for the current operation.
             | 
| InvalidOperationException | The metric set is not checked out to the caller
            or
            the underlying IAnalysisStructure does not support the current operation, either because it is not auto-generated
            or
            joining to the structure specified by elementParentId is not supported. | 
| ArgumentNullException | metricSet is . | 
| NotFoundException | The structure with the specified elementParentId or hierarchyParentId does not exist. | 
| InvalidSessionException | The caller context is not associated with a valid session. | 
| InvalidOperationException | Adding an element to the metric set will exceed the configured maximum. | 
See Also