Class CalculatedColumn
- Inheritance
-
CalculatedColumn
- Implements
- Inherited Members
- Namespace
- TabularEditor.TOMWrapper
- Assembly
- TOMWrapper.dll
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.
public sealed class CalculatedColumn : Column, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IFolderObject, ITabularTableObject, ITomErrorMessageObject, IDescriptionObject, IFormattableObject, ILineageTagObject, IChangedPropertiesObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IDaxObject, IClonableObject, IDaxDependantObject, IExpressionObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, IHandlerObject, INamedObject
- Extension Methods
Properties
DependsOn
Gets the list of objects that this calculated column depends on.
[Browsable(false)]
public DependsOnList DependsOn { get; }
Property Value
| Type | Description |
|---|---|
| DependsOnList |
EvaluationBehavior
Evaluation behavior for calculated column.
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.
public string Expression { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Parent
The parent Table of the current Calculated Column.
public Table Parent { get; }
Property Value
| Type | Description |
|---|---|
| Table |
Methods
Clone(string, bool, Table)
Creates an exact copy of this CalculatedColumn object.
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.
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
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. |