Class NamedExpression
A named expression that can be used by one or more partitions.
Implements
Inherited Members
Namespace: TabularEditor.TOMWrapper
Assembly: TOMWrapper.dll
Syntax
public sealed class NamedExpression : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IDescriptionObject, ILineageTagObject, IAnnotationObject, IExtendedPropertyObject, IClonableObject, IExpressionObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Remarks
This metadata object is only supported when the compatibility level of the database is at 1400 or above.
Properties
Annotations
The collection of Annotations on the current Named Expression.
Declaration
[Browsable(true)]
public AnnotationCollection Annotations { get; }
Property Value
Type | Description |
---|---|
AnnotationCollection |
Description
The description of the expression, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Expression
The expression text.
Declaration
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
string |
ExpressionSource
A reference to the NamedExpression where the parameter associated with the remote model.
Declaration
[TypeConverter(typeof(NamedExpressionConverter))]
public NamedExpression ExpressionSource { get; set; }
Property Value
Type | Description |
---|---|
NamedExpression |
Remarks
This property is only supported when the compatibility level of the database is at 1570 or above.
ExtendedProperties
The collection of Extended Properties on the current Named Expression.
Declaration
public ExtendedPropertyCollection ExtendedProperties { get; }
Property Value
Type | Description |
---|---|
ExtendedPropertyCollection |
Kind
The dialect of the expression.
Declaration
public ExpressionKind Kind { get; set; }
Property Value
Type | Description |
---|---|
ExpressionKind |
LineageTag
A tag that represents the lineage of the object.
Declaration
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.
MAttributes
The string that has M attributes.
Declaration
public string MAttributes { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
This property is only supported when the compatibility level of the database is at 1535 or above.
ParameterValuesColumn
Client tools apply filters to this column using M parameter. The presence of this property indicates model owner allows Dax queries to override this parameter, and columns data type must match the type specified in the meta tag of the parameter..
Declaration
[TypeConverter(typeof(ColumnConverter))]
public Column ParameterValuesColumn { get; set; }
Property Value
Type | Description |
---|---|
Column |
Remarks
This property is only supported when the compatibility level of the database is at 1545 or above.
Parent
The parent Model of the current Named Expression.
Declaration
public Model Parent { get; }
Property Value
Type | Description |
---|---|
Model |
QueryGroup
QueryGroup associated with the expression.
Declaration
[TypeConverter(typeof(QueryGroupConverter))]
public QueryGroup QueryGroup { get; set; }
Property Value
Type | Description |
---|---|
QueryGroup |
Remarks
This property is only supported when the compatibility level of the database is at 1480 or above.
RemoteParameterName
The parameter name defined in source model, applicable only for proxy model and empty for local model.
Declaration
public string RemoteParameterName { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
This property is only supported when the compatibility level of the database is at 1570 or above.
SourceLineageTag
A tag that represents the lineage of the source for the object.
Declaration
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.
Methods
ClearAnnotations()
Removes all annotations from this object.
Declaration
public void ClearAnnotations()
ClearExtendedProperties()
Removes all Extended Properties from this object.
Declaration
public void ClearExtendedProperties()
Clone(string)
Creates an exact copy of this NamedExpression object.
Declaration
public NamedExpression Clone(string newName = null)
Parameters
Type | Name | Description |
---|---|---|
string | newName |
Returns
Type | Description |
---|---|
NamedExpression |
CreateNew(Model, string)
Creates a new NamedExpression and adds it to the parent Model. Also creates the underlying metadataobject and adds it to the TOM tree.
Declaration
public static NamedExpression CreateNew(Model parent, string name = null)
Parameters
Type | Name | Description |
---|---|---|
Model | parent | |
string | name |
Returns
Type | Description |
---|---|
NamedExpression |
GetAnnotation(int)
Gets the value of the annotation with the given index, assuming it exists.
Declaration
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.
Declaration
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 Named Expression.
Declaration
public IEnumerable<string> GetAnnotations()
Returns
Type | Description |
---|---|
IEnumerable<string> |
GetAnnotationsCount()
Gets the number of annotations on the current Named Expression.
Declaration
public int GetAnnotationsCount()
Returns
Type | Description |
---|---|
int |
GetExtendedProperties()
Gets a collection of all ExtendedProperty names on the current object.
Declaration
public IEnumerable<string> GetExtendedProperties()
Returns
Type | Description |
---|---|
IEnumerable<string> |
GetExtendedProperty(int)
Gets the value of the ExtendedProperty with the given index, assuming it exists.
Declaration
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.
Declaration
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.
Declaration
public int GetExtendedPropertyCount()
Returns
Type | Description |
---|---|
int |
GetExtendedPropertyType(int)
Gets the type of the ExtendedProperty with the given index, assuming it exists.
Declaration
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.
Declaration
public ExtendedPropertyType GetExtendedPropertyType(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
ExtendedPropertyType |
GetNewAnnotationName()
Returns a unique name for a new annotation.
Declaration
public string GetNewAnnotationName()
Returns
Type | Description |
---|---|
string |
GetNewExtendedPropertyName()
Returns a unique name for a new ExtendedProperty.
Declaration
public string GetNewExtendedPropertyName()
Returns
Type | Description |
---|---|
string |
HasAnnotation(string)
Returns true if an annotation with the given name exists. Otherwise false.
Declaration
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.
Declaration
public bool HasExtendedProperty(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
bool |
RemoveAnnotation(string)
Remove an annotation by the given name.
Declaration
public void RemoveAnnotation(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
RemoveExtendedProperty(string)
Remove an ExtendedProperty by the given name.
Declaration
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.
Declaration
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.
Declaration
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.
Declaration
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.
Declaration
public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
string | value | |
ExtendedPropertyType | type |