Class CalculatedColumn
Represents a column that is based on a DAX expression in a Table that also contains DataColumns and a RowNumberColumn. A CalculatedColumn can also be added to a calculated table.
Implements
Inherited Members
Namespace: TabularEditor.TOMWrapper
Assembly: TOMWrapper.dll
Syntax
public sealed class CalculatedColumn : Column, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IFolderObject, ITabularTableObject, ITomErrorMessageObject, IDescriptionObject, IFormattableObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IDaxObject, IClonableObject, IDaxDependantObject, IExpressionObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Properties
DependsOn
Gets the list of objects that this calculated column depends on.
Declaration
[Browsable(false)]
public DependsOnList DependsOn { get; }
Property Value
Type | Description |
---|---|
DependsOnList |
EvaluationBehavior
Evaluation behavior for calculated column.
Declaration
public EvaluationBehavior EvaluationBehavior { get; set; }
Property Value
Type | Description |
---|---|
EvaluationBehavior |
Remarks
This property is only supported when the compatibility level of the database is at Preview or above.
Expression
The DAX expression that is evaluated for the calculated column.
Declaration
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
string |
Parent
The parent Table of the current Calculated Column.
Declaration
public Table Parent { get; }
Property Value
Type | Description |
---|---|
Table |
Methods
Clone(string, bool, Table)
Creates an exact copy of this CalculatedColumn object.
Declaration
public CalculatedColumn Clone(string newName = null, bool includeTranslations = true, Table newParent = null)
Parameters
Type | Name | Description |
---|---|---|
string | newName | |
bool | includeTranslations | |
Table | newParent |
Returns
Type | Description |
---|---|
CalculatedColumn |
CreateNew(Table, string)
Creates a new CalculatedColumn and adds it to the parent Table. Also creates the underlying metadataobject and adds it to the TOM tree.
Declaration
public static CalculatedColumn CreateNew(Table parent, string name = null)
Parameters
Type | Name | Description |
---|---|---|
Table | parent | |
string | name |
Returns
Type | Description |
---|---|
CalculatedColumn |
Init()
Derived members should override this method to instantiate child objects
Declaration
protected override void Init()
Overrides
OnPropertyChanged(string, object, object)
Fired after a property is changed
Declaration
protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | |
object | oldValue | |
object | newValue |
Overrides
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.
Declaration
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. |