Objeto Tables (TMSL)
Se aplica a: SQL Server 2016 y versiones posteriores analysis Services Azure Analysis Services Fabric/Power BI Premium
Define las tablas contenidas en un modelo. Las tablas de un modelo se enlazan a tablas de una base de datos externa desde la que se importan o consultan los datos, o una tabla calculada construida a partir de una expresión DAX. Dentro de una tabla, uno o varios objetos Partition describen el origen de los datos. Entre tablas, un objeto Relationship especifica la cardinalidad, la dirección del filtro y otras propiedades de la relación.
Definición de objeto
Todos los objetos tienen un conjunto común de propiedades, como el nombre, el tipo, la descripción, una colección de propiedades y las anotaciones. Los objetos Table también tienen las siguientes propiedades.
dataCategory
Especifica el tipo de Tabla, normalmente sin especificar. Los valores válidos incluyen 0 - UNKNOWN, 1 - TIME, 2 - MEASURE, 3 - OTHER, 5 - QUANTITATIVE, 6- ACCOUNTS, 7 - CUSTOMERS, 8- PRODUCTS, 9 - SCENARIO, 10- UTILITY, 11 - CURRENCY, 12 - RATES, 13 - CHANNEL, 4 - PROMOTION, 15 - ORGANIZATION, 16 - BILL OF MATERIALS, 17 – GEOGRAPHY.
isHidden
Un valor booleano que indica si la tabla se trata como oculta por las herramientas de visualización de cliente.
Es true si el elemento Table se trata como oculto; de lo contrario, es false.
columns
Representa una columna de una tabla. Es un elemento secundario de un objeto Table. Cada columna tiene una serie de propiedades definidas en ella que influyen en cómo las aplicaciones cliente visualizan los datos en la columna.
medidas
Representa un valor que se calcula según una expresión. Es un elemento secundario de un objeto Table.
Jerarquías
Representa una colección de niveles que proporcionan una ruta de acceso jerárquica lógica para explorar en profundidad aplicaciones cliente. Es un elemento secundario de un objeto Table.
Uso
Los objetos Table se usan en alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), Delete command (TMSL), Refresh command (TMSL), and MergePartitions command (TMSL)).
Al crear, reemplazar o modificar un objeto de tabla, especifique todas las propiedades de lectura y escritura de la definición de objeto. La omisión de una propiedad de lectura y escritura se considera una eliminación.
Sintaxis condensada
Las definiciones de objetos de tabla son complejas. Esta sintaxis contrae las propiedades interiores y los objetos para darle un vistazo de alto nivel a las partes principales.
"tables": {
"type": "array",
"items": {
"description": "Table object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"dataCategory": { },
"description": { },
"isHidden": { },
"partitions": { },
"annotations": { },
"columns": { },
"measures": { },
"hierarchies": { },
Sintaxis completa
A continuación se muestra la representación de esquema de un objeto tables de un modelo. Para reducir el tamaño de esta definición, los objetos Partition se describen en otro lugar. Vea Partitions object (TMSL) (Objeto Partitions [TMSL]).
"tables": {
"type": "array",
"items": {
"description": "Table object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"dataCategory": {
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"isHidden": {
"type": "boolean"
},
"partitions": {
},
"columns": {
"type": "array",
"items": {
"anyOf": [
{
"description": "DataColumn object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"dataType": {
"enum": [
"automatic",
"string",
"int64",
"double",
"dateTime",
"decimal",
"boolean",
"binary",
"unknown",
"variant"
]
},
"dataCategory": {
"type": "string"
},
"description": {
"type": "string"
},
"isHidden": {
"type": "boolean"
},
"isUnique": {
"type": "boolean"
},
"isKey": {
"type": "boolean"
},
"isNullable": {
"type": "boolean"
},
"alignment": {
"enum": [
"default",
"left",
"right",
"center"
]
},
"tableDetailPosition": {
"type": "integer"
},
"isDefaultLabel": {
"type": "boolean"
},
"isDefaultImage": {
"type": "boolean"
},
"summarizeBy": {
"enum": [
"default",
"none",
"sum",
"min",
"max",
"count",
"average",
"distinctCount"
]
},
"type": {
"enum": [
"data",
"calculated",
"rowNumber",
"calculatedTableColumn"
]
},
"formatString": {
"type": "string"
},
"isAvailableInMdx": {
"type": "boolean"
},
"keepUniqueRows": {
"type": "boolean"
},
"displayOrdinal": {
"type": "integer"
},
"sourceProviderType": {
"type": "string"
},
"displayFolder": {
"type": "string"
},
"sourceColumn": {
"type": "string"
},
"sortByColumn": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
{
"description": "CalculatedTableColumn object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"dataType": {
"enum": [
"automatic",
"string",
"int64",
"double",
"dateTime",
"decimal",
"boolean",
"binary",
"unknown",
"variant"
]
},
"dataCategory": {
"type": "string"
},
"description": {
"type": "string"
},
"isHidden": {
"type": "boolean"
},
"isUnique": {
"type": "boolean"
},
"isKey": {
"type": "boolean"
},
"isNullable": {
"type": "boolean"
},
"alignment": {
"enum": [
"default",
"left",
"right",
"center"
]
},
"tableDetailPosition": {
"type": "integer"
},
"isDefaultLabel": {
"type": "boolean"
},
"isDefaultImage": {
"type": "boolean"
},
"summarizeBy": {
"enum": [
"default",
"none",
"sum",
"min",
"max",
"count",
"average",
"distinctCount"
]
},
"type": {
"enum": [
"data",
"calculated",
"rowNumber",
"calculatedTableColumn"
]
},
"formatString": {
"type": "string"
},
"isAvailableInMdx": {
"type": "boolean"
},
"keepUniqueRows": {
"type": "boolean"
},
"displayOrdinal": {
"type": "integer"
},
"sourceProviderType": {
"type": "string"
},
"displayFolder": {
"type": "string"
},
"isNameInferred": {
"type": "boolean"
},
"isDataTypeInferred": {
"type": "boolean"
},
"sourceColumn": {
"type": "string"
},
"sortByColumn": {
"type": "string"
},
"columnOriginTable": {
"type": "string"
},
"columnOriginColumn": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
{
"description": "CalculatedColumn object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"dataType": {
"enum": [
"automatic",
"string",
"int64",
"double",
"dateTime",
"decimal",
"boolean",
"binary",
"unknown",
"variant"
]
},
"dataCategory": {
"type": "string"
},
"description": {
"type": "string"
},
"isHidden": {
"type": "boolean"
},
"isUnique": {
"type": "boolean"
},
"isKey": {
"type": "boolean"
},
"isNullable": {
"type": "boolean"
},
"alignment": {
"enum": [
"default",
"left",
"right",
"center"
]
},
"tableDetailPosition": {
"type": "integer"
},
"isDefaultLabel": {
"type": "boolean"
},
"isDefaultImage": {
"type": "boolean"
},
"summarizeBy": {
"enum": [
"default",
"none",
"sum",
"min",
"max",
"count",
"average",
"distinctCount"
]
},
"type": {
"enum": [
"data",
"calculated",
"rowNumber",
"calculatedTableColumn"
]
},
"formatString": {
"type": "string"
},
"isAvailableInMdx": {
"type": "boolean"
},
"keepUniqueRows": {
"type": "boolean"
},
"displayOrdinal": {
"type": "integer"
},
"sourceProviderType": {
"type": "string"
},
"displayFolder": {
"type": "string"
},
"isDataTypeInferred": {
"type": "boolean"
},
"expression": {
"type": "string"
},
"sortByColumn": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
]
}
},
"measures": {
"type": "array",
"items": {
"description": "Measure object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"expression": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"formatString": {
"type": "string"
},
"isHidden": {
"type": "boolean"
},
"isSimpleMeasure": {
"type": "boolean"
},
"displayFolder": {
"type": "string"
},
"kpi": {
"description": "KPI object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"targetDescription": {
"type": "string"
},
"targetExpression": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"targetFormatString": {
"type": "string"
},
"statusGraphic": {
"type": "string"
},
"statusDescription": {
"type": "string"
},
"statusExpression": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"trendGraphic": {
"type": "string"
},
"trendDescription": {
"type": "string"
},
"trendExpression": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
},
"hierarchies": {
"type": "array",
"items": {
"description": "Hierarchy object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"isHidden": {
"type": "boolean"
},
"displayFolder": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
},
"levels": {
"type": "array",
"items": {
"description": "Level object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"ordinal": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"column": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}