Table of Contents

Class Hierarchy

Inheritance
Hierarchy
Implements
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Represents a collection of levels that provide a logical hierarchical drilldown path for client applications. It is a child of a Table object.

public sealed class Hierarchy : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IFolderObject, ITabularTableObject, IDescriptionObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IClonableObject, ITabularObjectContainer, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Extension Methods

Properties

Annotations

The collection of Annotations on the current Hierarchy.

[Browsable(true)]
public AnnotationCollection Annotations { get; }

Property Value

Type Description
AnnotationCollection

DaxObjectFullName

Gets a fully qualified reference to this hirearchy

[Browsable(false)]
public string DaxObjectFullName { get; }

Property Value

Type Description
string

Description

The description of the hierarchy, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.

public string Description { get; set; }

Property Value

Type Description
string

DisplayFolder

Defines the display folder for the hierarchy, for use by clients.

public string DisplayFolder { get; set; }

Property Value

Type Description
string

ErrorMessage

public string ErrorMessage { get; }

Property Value

Type Description
string

ExtendedProperties

The collection of Extended Properties on the current Hierarchy.

public ExtendedPropertyCollection ExtendedProperties { get; }

Property Value

Type Description
ExtendedPropertyCollection

HideMembers

Ragged/unbalanced hierarchies can be enabled by hiding members using this property.

public HierarchyHideMembersType HideMembers { get; set; }

Property Value

Type Description
HierarchyHideMembersType

Remarks

This property is only supported when the compatibility level of the database is at 1400 or above.

InPerspective

[Browsable(true)]
public PerspectiveHierarchyIndexer InPerspective { get; }

Property Value

Type Description
PerspectiveHierarchyIndexer

IsHidden

A boolean value that indicates whether the hierarchy is treated as hidden by client visualization tools. True if the hierarchy is treated as hidden; otherwise false.

public bool IsHidden { get; set; }

Property Value

Type Description
bool

IsVisible

Gets the visibility of the Hierarchy. Takes into consideration that a hierarchy is not visible if its parent table is hidden.

[Browsable(false)]
public bool IsVisible { get; }

Property Value

Type Description
bool

Levels

The collection of Level objects on this Hierarchy.

[Browsable(false)]
public LevelCollection Levels { get; }

Property Value

Type Description
LevelCollection

LineageTag

A tag that represents the lineage of the object.

public string LineageTag { get; set; }

Property Value

Type Description
string

Remarks

This property is only supported when the compatibility level of the database is at 1540 or above.

Parent

The parent Table of the current Hierarchy.

public Table Parent { get; }

Property Value

Type Description
Table

Reordering

Set to true, when multiple levels are going to be re-ordered as one action.

[Browsable(false)]
public bool Reordering { get; }

Property Value

Type Description
bool

SourceLineageTag

A tag that represents the lineage of the source for the object.

public string SourceLineageTag { get; set; }

Property Value

Type Description
string

Remarks

This property is only supported when the compatibility level of the database is at 1550 or above.

State

Provides information on the state of the hierarchy. Possible values and their interpretation are as follows. Ready (1) The hierarchy is queryable and has up-to-date data. NoData (3) Not applicable to Hierarchy. CalculationNeeded (4) The hierarchy does not contain any data because it was not refreshed. There is no error associated with the hierarchy. SemanticError (5) Not applicable to Hierarchy. EvaluationError (6) Not applicable to Hierarchy. DependencyError (7) A dependency associated with the hierarchy is in an error state (SemanticError, EvaluationError, or DependencyError). Incomplete (8) Not applicable to Hierarchy.

public ObjectState State { get; }

Property Value

Type Description
ObjectState

Synonyms

Collection of localized synonyms for this Hierarchy.

[Browsable(true)]
public SynonymIndexer Synonyms { get; }

Property Value

Type Description
SynonymIndexer

Table

The parent table of the current Hierarchy.

[Browsable(false)]
public Table Table { get; }

Property Value

Type Description
Table

TranslatedDescriptions

Collection of localized descriptions for this Hierarchy.

[Browsable(true)]
public TranslationIndexer TranslatedDescriptions { get; }

Property Value

Type Description
TranslationIndexer

TranslatedDisplayFolders

Collection of localized Display Folders for the current Hierarchy.

[Browsable(true)]
public TranslationIndexer TranslatedDisplayFolders { get; }

Property Value

Type Description
TranslationIndexer

TranslatedNames

Collection of localized names for this Hierarchy.

[Browsable(true)]
public TranslationIndexer TranslatedNames { get; }

Property Value

Type Description
TranslationIndexer

UsedInVariations

Enumerates the Variation objects in which this hierarchy is used

[Browsable(false)]
public IEnumerable<Variation> UsedInVariations { get; }

Property Value

Type Description
IEnumerable<Variation>

Methods

AddLevel(string, string, int)

Adds a level to the current hirearchy.

public Level AddLevel(string columnName, string levelName = null, int ordinal = -1)

Parameters

Type Name Description
string columnName
string levelName
int ordinal

Returns

Type Description
Level

AddLevel(Column, string, int)

Adds a level to the current hirearchy.

public Level AddLevel(Column column, string levelName = null, int ordinal = -1)

Parameters

Type Name Description
Column column
string levelName
int ordinal

Returns

Type Description
Level

AddLevels(IEnumerable<Column>, int)

Adds a set of levels to the current hirearchy.

public void AddLevels(IEnumerable<Column> columns, int ordinal = -1)

Parameters

Type Name Description
IEnumerable<Column> columns
int ordinal

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

ClearExtendedProperties()

Removes all Extended Properties from this object.

public void ClearExtendedProperties()

Clone(string, bool, Table)

Creates an exact copy of this Hierarchy object.

public Hierarchy Clone(string newName = null, bool includeTranslations = true, Table newParent = null)

Parameters

Type Name Description
string newName
bool includeTranslations
Table newParent

Returns

Type Description
Hierarchy

CompactLevelOrdinals()

public void CompactLevelOrdinals()

CreateNew(Table, string)

Creates a new Hierarchy and adds it to the parent Table. Also creates the underlying metadataobject and adds it to the TOM tree.

public static Hierarchy CreateNew(Table parent, string name = null)

Parameters

Type Name Description
Table parent
string name

Returns

Type Description
Hierarchy

FixLevelOrder(Level, int)

public void FixLevelOrder(Level level, int newOrdinal)

Parameters

Type Name Description
Level level
int newOrdinal

GetAnnotation(int)

Gets the value of the annotation with the given index, assuming it exists.

public string GetAnnotation(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetAnnotation(string)

Gets the value of the annotation with the given name. Returns null if no such annotation exists.

public string GetAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetAnnotations()

Gets a collection of all annotation names on the current Hierarchy.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Hierarchy.

public int GetAnnotationsCount()

Returns

Type Description
int

GetChildren()

public IEnumerable<ITabularNamedObject> GetChildren()

Returns

Type Description
IEnumerable<ITabularNamedObject>

GetExtendedProperties()

Gets a collection of all ExtendedProperty names on the current object.

public IEnumerable<string> GetExtendedProperties()

Returns

Type Description
IEnumerable<string>

GetExtendedProperty(int)

Gets the value of the ExtendedProperty with the given index, assuming it exists.

public string GetExtendedProperty(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetExtendedProperty(string)

Gets the value of the ExtendedProperty with the given name. Returns null if no such ExtendedProperty exists.

public string GetExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetExtendedPropertyCount()

Gets the number of ExtendedProperties on the current object.

public int GetExtendedPropertyCount()

Returns

Type Description
int

GetExtendedPropertyType(int)

Gets the type of the ExtendedProperty with the given index, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(int index)

Parameters

Type Name Description
int index

Returns

Type Description
ExtendedPropertyType

GetExtendedPropertyType(string)

Gets the type of the ExtendedProperty with the given name, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(string name)

Parameters

Type Name Description
string name

Returns

Type Description
ExtendedPropertyType

GetNewAnnotationName()

Returns a unique name for a new annotation.

public string GetNewAnnotationName()

Returns

Type Description
string

GetNewExtendedPropertyName()

Returns a unique name for a new ExtendedProperty.

public string GetNewExtendedPropertyName()

Returns

Type Description
string

HasAnnotation(string)

Returns true if an annotation with the given name exists. Otherwise false.

public bool HasAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

HasExtendedProperty(string)

Returns true if an ExtendedProperty with the given name exists. Otherwise false.

public bool HasExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

Init()

Derived members should override this method to instantiate child objects

protected override void Init()

RemoveAnnotation(string)

Remove an annotation by the given name.

public void RemoveAnnotation(string name)

Parameters

Type Name Description
string name

RemoveExtendedProperty(string)

Remove an ExtendedProperty by the given name.

public void RemoveExtendedProperty(string name)

Parameters

Type Name Description
string name

SetAnnotation(int, string)

Sets the value of the annotation with the given index, assuming it exists.

public void SetAnnotation(int index, string value)

Parameters

Type Name Description
int index
string value

SetAnnotation(string, string)

Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.

public void SetAnnotation(string name, string value)

Parameters

Type Name Description
string name
string value

SetExtendedProperty(int, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty with the given index, optionally specifiying the type (string or JSON) of the ExtendedProperty.

public void SetExtendedProperty(int index, string value, ExtendedPropertyType type)

Parameters

Type Name Description
int index
string value
ExtendedPropertyType type

SetExtendedProperty(string, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty having the given name. If no such ExtendedProperty exists, it will be created. If value is set to null, the ExtendedProperty will be removed.

public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)

Parameters

Type Name Description
string name
string value
ExtendedPropertyType type

SetLevelOrder(IList<Level>)

public void SetLevelOrder(IList<Level> order)

Parameters

Type Name Description
IList<Level> order