TML for Worksheets
Use TML to modify a ThoughtSpot object in a flat-file format. Then, migrate the object to a different cluster, or restore it to the same cluster.
To work with TML files for Worksheets, you can download these objects to flat files in
.TML format, modify the files, and subsequently upload the files either to the same cluster, or to a different cluster.
To learn how to export, change, and update Worksheets, see Import and export TML files.
The syntax examples in this article contain every possible parameter in TML files for Worksheets.
Some of these parameters are not in these files by default.
If you want to use them, you must add them yourself.
For example, the
fqn parameter is not present in any TML file by default, but you can add it to differentiate a table from another table with the same name.
As you work with TML files, keep in mind that changing elements of the TML file, such as the name of a column or table, may affect dependents. This is specifically true if you are editing TML files outside ThoughtSpot. When you change the name of a table in a TML file, and then import that file into ThoughtSpot, ThoughtSpot automatically updates that table name in any dependents, such as Answers that use the table as a data source. However, if you download multiple TML files from one ThoughtSpot cluster, then change the table name in TML, and upload all the files to a brand-new cluster, ThoughtSpot doesn’t know that the dependents should use that table. You must also change the table name in the dependents.
TML file for Worksheets has a specific syntax.
See the TML parameters for Worksheets for details about the keywords used in this example.
See Limitations of working with TML files for more information about actions you can’t perform using TML.
You may not see each of these parameters in your own TML files, depending on whether each variable is explicitly defined.
For example, if you do not have any filters on your worksheet, the
filters parameter does not appear.
You can add that variable to the TML file to specify filters for your worksheet.
To reduce ambiguity, you may need to add the optional
fqn parameter to your TML file when you reference source tables or connections. This is necessary if you have multiple connections or tables with the same name. If you do not add the
fqn parameter, and the connection or table you reference does not have a unique name, the file import fails.
Refer to TML for joins for more information on the functionality and syntax of Worksheet joins in TML.
|If you edit the joins in the Worksheet TML file, you are only editing the joins for that specific worksheet. You are not editing the joins at the table level. To modify table-level joins, you must edit the source table’s TML file.|
guid: <worksheet_guid> worksheet: name: <worksheet_name> description: This is a multi-line description of the worksheet Description line 2 tables: - name: <table_name_1> id : <optional_table_id> fqn : <optional_GUID_of_table_name> - name: <table_name_2> - name: <table_name_n> joins: - name: <join_name_1> source: <source_table_name> destination: <destination_table_name> type: [RIGHT_OUTER | LEFT_OUTER | INNER | OUTER] on: <join_expression_string> is_one_to_one: [ false | true ] - ... table_paths: - id: <table_path_name_1> table: <table_name_1> join_path: - join: - <join_name_1> - <join_name_n> - id: <table_path_name_2> table: <table_name_2> join_path: - join: - <join_name_2> - id: <table_path_name_n> table: <table_name_n> join_path: - join: - <join_name_n> formulas: - name: <formula_name_1> expr: <formula_definition_1> [id]: <optional_unique_identifier> - name: <formula_name_2> expr: <formula_definition_2> - name: <formula_name_3> expr: <formula_definition_3> filters: - column: <filtered_column_name_1> oper: <filter_operator> values: <filtered_values> - value 1 - value 2 - value n - column: <filtered_column_name_2> worksheet_columns: - name: <column_name_1> description: <optional_column_description> column_id: <table_path>::<column_id_1> properties: column_type: [ MEASURE | ATTRIBUTE ] aggregation: [ SUM | COUNT | AVERAGE | MAX | MIN | COUNT_DISTINCT | NONE | STD_DEVIATION | VARIANCE] index_type: [ DONT_INDEX | DEFAULT | PREFIX_ONLY | PREFIX_AND_SUBSTRING | PREFIX_AND_WORD_SUBSTRING ] index_priority: <index_priority> synonyms : <synonym_1> <synonym_2> is_attribution_dimension : [true | false] is_additive : [ true | false ] calendar : [ default | calendar_name ] format_pattern : <format_pattern_string> currency_type : is_browser : true OR column : <column_name> OR iso_code : <valid_ISO_code> is_hidden: [ true | false ] geo_config : latitude : true OR longitude : true OR country : true OR region_name: - country : <name_supported_country> - region_name : <region_name_in_UI> spotiq_preference: <spotiq_preference_string> name: <column_name_2> description: <column_description> column_id: <table_path>::<column_id_2> ... properties: is_bypass_rls: [ true | false ] join_progressive: [ true | false ] lesson_plans - lesson_id: <lesson_id_number_1> lesson_plan_string <lesson_plan_string_1> - lesson_id: <lesson_id_number_2> lesson_plan_string <lesson_plan_string_2> - lesson_id: <lesson_id_number_n> lesson_plan_string <lesson_plan_string_n> joins_with: - name: <join_name_1> description: <optional_join_description_1> destination: name: <destination_table_name_1> fqn: <optional_table_guid_1> on: <join_expression_string_1> type: [RIGHT_OUTER | LEFT_OUTER | INNER | OUTER] is_one_to_one: [ false | true ] name: <join_name_2> name: <join_name_n>
These parameters and their definitions are specific to Worksheets; this list doesn’t contain every parameter in every TML file. Similarly, the parameter definitions may vary from object to object, since the parameters may have different roles in different objects.
|a - g||i - l||n - w|
The default aggregation of the Worksheet column.
Aggregation options depend on the data type.
Possible values are
Specifies the calendar used by a date column.
Can be the Gregorian calendar (
default), a fiscal calendar, or any custom calendar.
The id of the column(s) being filtered on.
idof the Worksheet column.
column_idis in the following format:
Table.column. For example:
The type of data the column represents.
ATTRIBUTE. The default is:
The source of the currency type.
The GUID for a custom map uploaded by an administrator.
The text that describes an object: a worksheet, a worksheet column, or a join.
The name of the destination table or view for a join.
The definition of the formula.
Contains specifications for Worksheet filters.
The format pattern string that controls the display of a number, date, or currency column.
The list of formulas in the Worksheet.
Each formula is identified by
expr(expression), and an optional
The table or connection’s GUID. You can find this string of letters and numbers at the end of the URL for that table or connection.
For example, in
https://<company>.thoughtspot.com/#/data/tables/34226aaa-4bcf-4d6b-9045-24cb1e9437cb, the GUID is
Use this optional parameter to reduce ambiguity and identify a specific table, if you have multiple tables with the same name. When exporting a TML file, you have the option to Export FQNs of referenced objects, which ensures that the TML files you export contain FQNs for the underlying tables and connections. If you do not add the
fqnparameter, and the connection or table you reference does not have a unique name, the file import fails.
Specifies the geographic information of a column. See Add a geographical data setting
latitude : true
for columns that specify the latitude
longitude : true
for columns that specify the longitude
country : true
for columns that specify the country
for specifying a region in a country
Uses two paired parameters:
region_name: <region_name_in_UI>; can be State, Postal Code, District, and so on.
The GUID for the Worksheet. You can find this string of letters and numbers at the end of the URL for an object.
Specifies the id of an object, such as
A value (1-10) that determines where to rank a column’s name and values in the search suggestions
ThoughtSpot prioritizes columns with higher values.
Controls extended aggregate options for attribute columns.
For attribute columns that have a numeric data type (
INTEGER) or a date data type (
Controls if the column is an attribution dimension.
Used in managing chasm traps.
falseto designate a column as not producing meaningful attributions across a chasm trap
Specifies if the Worksheet supports bypass of Row-level security (RLS) rules.
Specifies the cardinality of the join. This is an optional parameter.
Specific join, used in defining higher-level objects, such as table paths.
Specification of a composite join as a list of distinct
joinattributes list relevant joins, previously defined in the
joins, by name.
Specifies when to apply joins on a Worksheet.
truewhen joins are applied only for tables whose columns are included in the search, and
falsefor all possible joins
Contains a list of joins between the tables and views.
If you edit the joins in the Worksheet TML file, you are only editing the joins for that specific Worksheet. You are not editing the joins at the table level. To modify table-level joins, you must edit the source table’s TML file.
Each join is identified by
name, and the additional attributes of
Contains a list of external joins for which this Worksheet is the source.
Each join is identified by
description, and the additional attributes of
The numeric ID of the Search Assist Coach lesson created for the Worksheet. The first lesson shown to users has an ID of 0, the second lesson has an ID of 1, and so on.
The content of the Search Assist Coach lesson created for the Worksheet. For example,
"What were [Lo Tax] by [Lo Shipmode] in [Lo Commitdate].'2019' ?".
Contains a list of Search Assist Coach lessons created for the Worksheet.
The name of an object. Applies to
destination, and so on.
The join expression: the relationship definition, or the keys that your objects are joined on. For example,
[sale::Sale_Last Name] = [employee::Employee_Last Name] AND [sale::Sale_First Name] = [employee::Employee_First Name].
The operator of the Worksheet filter. Accepted operators are
The list of properties of a Worksheet column, a Worksheet itself, or the properties of the output for a formula within a Worksheet.
Each column can have the following properties, depending on its definition:
Worksheets themselves can have the following properties that affect query generation:
Name of the source table or view for a join.
Specifies whether to include a column in SpotIQ analysis. Specify
EXCLUDE, or this property defaults to include the column in SpotIQ Analysis.
Alternate names for the column, used in search.
See Hide a column.
Specific table, used in defining higher-level objects, such as table paths.
The list of table paths. Each table path is identified by the
id, and additional attributes of
List of tables used by the Worksheet.
Each table is identified by
The join type. This is an optional parameter.
LEFT_OUTERfor left outer join,
RIGHT_OUTERfor right outer join,
INNERfor inner join,
OUTERfor full outer join.
The values being filtered (excluded or included) in a Worksheet.
Top-level container for all object definitions within the Worksheet.
The list of columns in the Worksheet.
Each Worksheet is identified by
There are certain limitations to the changes you can apply by editing Worksheets through TML.
Formulas and columns can either have a new name, or a new expression. You can’t change both, unless migrating or updating the Worksheet two times.
It isn’t possible to reverse the join direction in the TML script.
You can’t import manually compressed .zip files. You can only import .zip files that you exported from ThoughtSpot: a custom set of TML files, an object and its associated data sources, or multiple objects of the same type that you exported from the object list page.
You can’t modify joins at the table level from the Worksheet, view, or Answer TML file. You can only override the joins for that specific Worksheet, view, or Answer. To modify table-level joins, you must edit the source table’s TML file.
When deleting columns, you only delete ThoughtSpot’s record of the column. You don’t delete the column in your external database.