Table of Contents

Class Column

Inheritance
Column
Implements
Derived
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Represents a base class of a column object of a Tabular model, used to specify a DataColumn, RowNumberColumn, CalculatedColumn, or CalculatedTableColumn.

public abstract class Column : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IFolderObject, ITabularTableObject, ITomErrorMessageObject, IDescriptionObject, IFormattableObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IDaxObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Extension Methods

Properties

Alignment

Specifies the text alignment of the column in report visualizations. The possible values are Default (1), Left (2), Right (3), Center (4).

public Alignment Alignment { get; set; }

Property Value

Type Description
Alignment

AlternateOf

Gets or sets the Alternate Of configuration used to specify aggregations.

public AlternateOf AlternateOf { get; set; }

Property Value

Type Description
AlternateOf

Annotations

The collection of Annotations on the current Column.

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

Property Value

Type Description
AnnotationCollection

DataCategory

Specifies the type of data contained in the column so that you can add custom behaviors based on column type. There are 248 possible values. The first ten are Invalid (-1), All (1), Regular (2), Image (3), ImageBMP (4), ImageGIF (5), ImageJPG (6), ImagePNG (7), ImageTIFF (8), ImageURL (9), Id (10). For the rest, please refer to the MS-SSAS-T SQL Server Analysis Services Tabular Protocol documentation on MSDN.

[TypeConverter(typeof(ColumnDataCategoryConverter))]
public string DataCategory { get; set; }

Property Value

Type Description
string

DataType

For a DataColumn, specifies the data type. See https://msdn.microsoft.com/library/gg492146.aspx for a list of supported data types.

[TypeConverter(typeof(DataTypeEnumConverter))]
public DataType DataType { get; set; }

Property Value

Type Description
DataType

DaxObjectFullName

Gets a fully qualified DAX reference to this column

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

Property Value

Type Description
string

DaxObjectName

Gets an unqualified DAX reference to this column

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

Property Value

Type Description
string

DaxTableName

Gets a DAX reference to the table on which this column resides

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

Property Value

Type Description
string

Description

The description of the column, 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 column, for use by clients.

public string DisplayFolder { get; set; }

Property Value

Type Description
string

DisplayOrdinal

Indicates the visual position of the column, defined as a relative ordering rather than a strict ordering (example: 10, 20, 40, 50). It allows client applications to maintain a consistent column position.

public int DisplayOrdinal { get; set; }

Property Value

Type Description
int

EncodingHint

This property allows an encoding hint to be specified for the column. A numeric column may use either value-based encoding or hash-based encoding. Usually the server will automatically attempt detect which encoding to use, but re-encoding may occur later. This property allows hinting to the server that it should start with a different encoding type.

public EncodingHintType EncodingHint { get; set; }

Property Value

Type Description
EncodingHintType

Remarks

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

ErrorMessage

A string that explains the error state associated with the current object. It is set by the engine only when the state of the object is one of these three values: SemanticError, DependencyError, or EvaluationError. It is applicable only to columns of the type Calculated or CalculatedTableColumn. It will be empty for other column objects.

public string ErrorMessage { get; }

Property Value

Type Description
string

ExtendedProperties

The collection of Extended Properties on the current Column.

public ExtendedPropertyCollection ExtendedProperties { get; }

Property Value

Type Description
ExtendedPropertyCollection

FormatString

A string that specifies the format of the column contents.

[TypeConverter(typeof(FormatStringConverter))]
public string FormatString { get; set; }

Property Value

Type Description
string

GroupByColumns

A collection of columns that should be grouped together with this column when used in visuals (RelatedColumnDetails).

public GroupingColumnCollection GroupByColumns { get; }

Property Value

Type Description
GroupingColumnCollection

InPerspective

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

Property Value

Type Description
PerspectiveColumnIndexer

IsAvailableInMDX

A boolean value that indicates whether the column can be excluded from usage in MDX query tools. False if the column can be excluded from usage in MDX query tools; otherwise true.

public bool IsAvailableInMDX { get; set; }

Property Value

Type Description
bool

IsDataTypeInferred

A boolean value indicating whether the datatype is inferred.

public bool IsDataTypeInferred { get; set; }

Property Value

Type Description
bool

IsDefaultImage

A boolean value that indicates whether this column is returned as the DefaultImage property in CSDL.

public bool IsDefaultImage { get; set; }

Property Value

Type Description
bool

IsDefaultLabel

A boolean value that indicates whether this column is included in the DisplayKey element in CSDL.

public bool IsDefaultLabel { get; set; }

Property Value

Type Description
bool

IsHidden

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

public bool IsHidden { get; set; }

Property Value

Type Description
bool

IsKey

A boolean value that indicates whether the column is a key of the table. True if the column is a key of the table; otherwise false.

public bool IsKey { get; set; }

Property Value

Type Description
bool

IsNullable

If false, the column cannot contain nulls. Even if true, it may still not allow nulls if it's a key column.

public bool IsNullable { get; set; }

Property Value

Type Description
bool

IsUnique

A boolean value that indicates whether the column contains only unique values. True if the values are unique; otherwise false.

public bool IsUnique { get; set; }

Property Value

Type Description
bool

IsVisible

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

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

Property Value

Type Description
bool

KeepUniqueRows

Specifies the grouping behavior used for building a hierarchy. True groups by entity key. False groups by value.

public bool KeepUniqueRows { get; set; }

Property Value

Type Description
bool

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.

ObjectLevelSecurity

Gets the OLS settings applied to this column

public ColumnOLSIndexer ObjectLevelSecurity { get; }

Property Value

Type Description
ColumnOLSIndexer

ReferencedBy

Gets the list of objects that reference this column.

[Browsable(false)]
public ReferencedByList ReferencedBy { get; }

Property Value

Type Description
ReferencedByList

SortByColumn

Indicates that the column defining this property will be sorted by the values of the column referenced by this property.

[TypeConverter(typeof(TableColumnConverter))]
public Column SortByColumn { get; set; }

Property Value

Type Description
Column

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.

SourceProviderType

The original data type of the column as defined in the language of the data source. This data type is used to generate queries directly against the data source, for example in DirectQuery mode.

public string SourceProviderType { get; set; }

Property Value

Type Description
string

State

Enumerates the state of the column. Possible values include the following. Ready (1) The column is queryable and has up-to-date data. NoData (3) The column is queryable but has no data. This state is applicable only to columns of the type Data. CalculationNeeded (4) The column is not queryable and needs to be refreshed (that is, recalculated) to become functional. This state applies only to columns of the type Calculated or CalculatedTableColumn. SemanticError (5) The column is in an error state because of an invalid expression. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. EvaluationError (6) The column is in an error state because of an error during expression evaluation. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. DependencyError (7) The column is in an error state because some of its calculation dependencies are in an error state. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. Incomplete (8) Some parts of the column have no data, and the column needs to be refreshed to bring the data in. The column is queryable. This state applies only to columns of the type Data. SyntaxError (9) The column is in an error state because of a syntax error in its expression. The column is not queryable. This state applies only to columns of the type Calculated.

public ObjectState State { get; }

Property Value

Type Description
ObjectState

SummarizeBy

A value indicating the default function, if any, used to aggregate this field. The possible values are Default (1), None (2), Sum (3), Min (4), Max (5), Count (6), Average (7), DistinctCount (8). If unspecified, Default is assumed for numeric fields, None for all other fields.

public AggregateFunction SummarizeBy { get; set; }

Property Value

Type Description
AggregateFunction

Synonyms

Collection of localized synonyms for this Column.

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

Property Value

Type Description
SynonymIndexer

Table

The parent table of the current Column.

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

Property Value

Type Description
Table

TableDetailPosition

Determines whether you can place this column in the DefaultDetails collection of the Table. This collection is an ordered set of Column types. A positive value indicates participation in the collection. The collection is sorted in ascending order of this element. The DefaultDetails collection is returned as part of the CSDL metadata returned by the DISCOVER_CSDL_METADATA operation.

public int TableDetailPosition { get; set; }

Property Value

Type Description
int

TranslatedDescriptions

Collection of localized descriptions for this Column.

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

Property Value

Type Description
TranslationIndexer

TranslatedDisplayFolders

Collection of localized Display Folders for the current Column.

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

Property Value

Type Description
TranslationIndexer

TranslatedNames

Collection of localized names for this Column.

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

Property Value

Type Description
TranslationIndexer

Type

Specifies the data binding. Values include Data (1) where the contents of this column come from a DataSource, Calculated (2) where the contents are computed from an expression after the Data columns have been populated, RowNumber (3) where the column is an internal column representing the row number, or CalculatedTableColumn (4) where tables that are based on a calculated expression will automatically infer and generate the columns in the table.

[Browsable(false)]
public ColumnType Type { get; }

Property Value

Type Description
ColumnType

UsedInAlternateOfs

Enumerates all AlternateOf objects in which this column is a BaseColumn.

[Browsable(false)]
public IEnumerable<AlternateOf> UsedInAlternateOfs { get; }

Property Value

Type Description
IEnumerable<AlternateOf>

UsedInHierarchies

Enumerates all hierarchies in which this column is used as a level.

[Browsable(false)]
public IEnumerable<Hierarchy> UsedInHierarchies { get; }

Property Value

Type Description
IEnumerable<Hierarchy>

UsedInLevels

Enumerates all hierarchy levels that are based on this column.

[Browsable(false)]
public IEnumerable<Level> UsedInLevels { get; }

Property Value

Type Description
IEnumerable<Level>

UsedInRelationships

Enumerates all relationships in which this column participates (either as FromColumn or ToColumn).

[Browsable(false)]
public IEnumerable<SingleColumnRelationship> UsedInRelationships { get; }

Property Value

Type Description
IEnumerable<SingleColumnRelationship>

UsedInSortBy

Enumerates all columns where this column is used as the SortBy column.

[Browsable(false)]
public IEnumerable<Column> UsedInSortBy { get; }

Property Value

Type Description
IEnumerable<Column>

UsedInVariations

Enumerates all Variation in which this column is used as a DefaultColumn.

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

Property Value

Type Description
IEnumerable<Variation>

Variations

The collection of Variation objects on this Column.

public VariationCollection Variations { get; protected set; }

Property Value

Type Description
VariationCollection

Methods

AddAlternateOf(Column, SummarizationType)

Marks this column as an alternate of a column in another table, for aggregation purposes. See AlternateOf.

public AlternateOf AddAlternateOf(Column column = null, SummarizationType summarization = SummarizationType.Sum)

Parameters

Type Name Description
Column column
SummarizationType summarization

Returns

Type Description
AlternateOf

AllowDelete(out string)

Derived classes should override this method to prevent an object from being deleted. If left un-overridden, always returns TRUE and sets message to null.

protected override bool AllowDelete(out string message)

Parameters

Type Name Description
string message

If an object CANNOT be deleted, this string should provide a reason why. If an object CAN be deleted, this string may optionally provide a suitable warning message that applies if the object is deleted immediately after the call to CanDelete.

Returns

Type Description
bool

True if an object can be deleted. False otherwise.

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

ClearExtendedProperties()

Removes all Extended Properties from this object.

public void ClearExtendedProperties()

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 Column.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Column.

public int GetAnnotationsCount()

Returns

Type Description
int

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()

OnPropertyChanged(string, object, object)

Fired after a property is changed

protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)

Parameters

Type Name Description
string propertyName
object oldValue
object newValue

OnPropertyChanging(string, object, ref bool, ref bool)

Called before a property is changed on an object. Derived classes can control how the change is handled. Throw ArgumentException within this method, to display an error message in the UI.

protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)

Parameters

Type Name Description
string propertyName

Name of the changed property.

object newValue

New value assigned to the property.

bool undoable

Return false if automatic undo of the property change is not needed.

bool cancel

Return true if the property change should not apply.

RelateTo(string, string)

Creates a relationship from the current column to another column.

public SingleColumnRelationship RelateTo(string tableName, string columnName)

Parameters

Type Name Description
string tableName
string columnName

Returns

Type Description
SingleColumnRelationship

Exceptions

ArgumentException

RelateTo(Column)

Creates a relationship from the current column to another column.

public SingleColumnRelationship RelateTo(Column column)

Parameters

Type Name Description
Column column

Returns

Type Description
SingleColumnRelationship

Exceptions

InvalidOperationException

RemoveAlternateOf()

Removes the AlternateOf configuration for this column.

public void RemoveAlternateOf()

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