Class Calendar
- Inheritance
-
Calendar
- Implements
- Inherited Members
- Namespace
- TabularEditor.TOMWrapper
- Assembly
- TOMWrapper.dll
Defines a logical calendar as part of the DAX Time-Intelligence support.
public sealed class Calendar : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, ITabularTableObject, IDescriptionObject, ILineageTagObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, IHandlerObject, INamedObject, IClonableObject
- Extension Methods
Remarks
This metadata object is only supported when the compatibility level of the database is at 1701 or above.
Properties
CalendarColumnGroups
The collection of CalendarColumnGroup objects on this Calendar.
public CalendarColumnGroupCollection CalendarColumnGroups { get; }
Property Value
Type | Description |
---|---|
CalendarColumnGroupCollection |
ColumnMappings
The collection of column mappings that define the calendar's time unit associations. This is an alias for CalendarColumnGroups.
public CalendarColumnGroupCollection ColumnMappings { get; }
Property Value
Type | Description |
---|---|
CalendarColumnGroupCollection |
Description
The description of the Calendar, 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 |
LineageTag
A tag that represents the lineage of the object.
public string LineageTag { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Lineage tags enable stable identification of objects across different semantic models. Using lineage tags enables Power BI features such as composite models to maintain their binding to referenced tables or columns, even if the source semantic model object is renamed.
Parent
The parent Table of the current Calendar.
public Table Parent { get; }
Property Value
Type | Description |
---|---|
Table |
SourceLineageTag
A tag that represents the lineage of the source for the object.
public string SourceLineageTag { get; set; }
Property Value
Type | Description |
---|---|
string |
Table
The parent table of the current Calendar.
[Browsable(false)]
public Table Table { get; }
Property Value
Type | Description |
---|---|
Table |
Methods
AddTimeUnit(TimeUnit, Column, params Column[])
Adds a new time unit association to the calendar.
public TimeUnitColumnAssociation AddTimeUnit(TimeUnit timeUnit, Column primaryColumn, params Column[] associatedColumns)
Parameters
Type | Name | Description |
---|---|---|
TimeUnit | timeUnit | The unit of time |
Column | primaryColumn | The primary column to associate with this time unit |
Column[] | associatedColumns | Additional associated columns (i.e. columns representing the same time unit as the primary column in other formats, languages, etc.) |
Returns
Type | Description |
---|---|
TimeUnitColumnAssociation |
Exceptions
Clone(string, Table)
Creates an exact copy of this Calendar object.
public Calendar Clone(string newName = null, Table newParent = null)
Parameters
Type | Name | Description |
---|---|---|
string | newName | |
Table | newParent |
Returns
Type | Description |
---|---|
Calendar |
CreateNew(Table, string)
Creates a new Calendar and adds it to the parent Table. Also creates the underlying metadataobject and adds it to the TOM tree.
public static Calendar CreateNew(Table parent, string name = null)
Parameters
Type | Name | Description |
---|---|---|
Table | parent | |
string | name |
Returns
Type | Description |
---|---|
Calendar |
DeleteTimeUnit(TimeUnit)
Removes the specified time unit association from the calendar.
public bool DeleteTimeUnit(TimeUnit timeUnit)
Parameters
Type | Name | Description |
---|---|---|
TimeUnit | timeUnit |
Returns
Type | Description |
---|---|
bool |
GetTimeUnits()
Returns all time unit associations in the calendar.
public IEnumerable<TimeUnitColumnAssociation> GetTimeUnits()
Returns
Type | Description |
---|---|
IEnumerable<TimeUnitColumnAssociation> |