### Scaffold an Example Test Suite Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Initialize a new test suite with example configurations. ```bash te test init --example ``` -------------------------------- ### Start Interactive REPL Session Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Initiate a guided REPL session with a model-aware prompt. Can be used to connect to an existing session later, start with a local model file, or connect to a remote model using workspace and model names. ```bash te interactive # Connect later te interactive ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model ``` -------------------------------- ### Build and Start Local Website Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/templates/tabulareditor/README.md Builds the templates and starts a local development server with automatic reloading for Sass and TypeScript changes. ```bash npm run start ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/templates/tabulareditor/README.md Installs all necessary Node.js dependencies for the project. ```bash npm install ``` -------------------------------- ### Starting Interactive Sessions Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-interactive.md Run these commands to start an interactive session. You can connect to a local model, a remote model, or connect later. ```bash te interactive # Start and connect to a model later te interactive ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model ``` -------------------------------- ### Install Tabular Editor CLI on Linux (x64) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the x64 version of the Tabular Editor CLI to ~/.local/bin, makes it executable, and adds it to the PATH in ~/.bashrc. ```bash mkdir -p ~/.local/bin tar -xzf te-linux-x64.tar.gz -C ~/.local/bin chmod +x ~/.local/bin/te echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc ``` -------------------------------- ### Install Tabular Editor CLI on Linux (ARM64) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the ARM64 version of the Tabular Editor CLI to ~/.local/bin, makes it executable, and adds it to the PATH in ~/.bashrc. ```bash mkdir -p ~/.local/bin tar -xzf te-linux-arm64.tar.gz -C ~/.local/bin chmod +x ~/.local/bin/te echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc ``` -------------------------------- ### Install Docfx Global Tool Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/templates/tabulareditor/README.md Installs the latest version of Docfx as a global tool using the .NET SDK. ```bash dotnet tool install -g docfx ``` -------------------------------- ### Custom Instruction YAML Frontmatter Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/ai-assistant.md Example of YAML frontmatter required for creating a custom instruction. This defines metadata like ID, name, description, priority, and triggers. ```yaml --- id: my-custom-skill name: My Custom Skill description: A brief description shown in the autocomplete popup. priority: 100 always_inject: false hidden: false triggers: keywords: - keyword1 - keyword2 patterns: - "\\bregex pattern\\b" context_required: - model_loaded --- Your instruction content goes here. This is the text that will be injected into the AI's system prompt when the instruction is activated. ``` -------------------------------- ### Install Tabular Editor CLI on macOS (Intel) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the x64 version of the Tabular Editor CLI to ~/.local/bin, makes it executable, and adds it to the PATH in ~/.zshrc. ```bash mkdir -p ~/.local/bin tar -xzf te-osx-x64.tar.gz -C ~/.local/bin chmod +x ~/.local/bin/te echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc ``` -------------------------------- ### Install Tabular Editor CLI on macOS (Apple Silicon) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the ARM64 version of the Tabular Editor CLI to ~/.local/bin, makes it executable, and adds it to the PATH in ~/.zshrc. ```bash mkdir -p ~/.local/bin tar -xzf te-osx-arm64.tar.gz -C ~/.local/bin chmod +x ~/.local/bin/te echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc ``` -------------------------------- ### Install Tabular Editor CLI on Windows (ARM64) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the ARM64 version of the Tabular Editor CLI and adds its directory to the user's PATH environment variable using PowerShell. ```powershell Expand-Archive te-win-arm64.zip -DestinationPath "$env:LOCALAPPDATA\Programs\te" [Environment]::SetEnvironmentVariable( "PATH", [Environment]::GetEnvironmentVariable("PATH", "User") + ";$env:LOCALAPPDATA\Programs\te", "User") ``` -------------------------------- ### Install Tabular Editor CLI on Windows (x64) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Installs the x64 version of the Tabular Editor CLI and adds its directory to the user's PATH environment variable using PowerShell. ```powershell Expand-Archive te-win-x64.zip -DestinationPath "$env:LOCALAPPDATA\Programs\te" [Environment]::SetEnvironmentVariable( "PATH", [Environment]::GetEnvironmentVariable("PATH", "User") + ";$env:LOCALAPPDATA\Programs\te", "User") ``` -------------------------------- ### Update Docfx Global Tool Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/templates/tabulareditor/README.md Updates an existing Docfx global tool installation to the latest version. ```bash dotnet tool update -g docfx ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/README.md Builds the English version of the documentation and serves it locally for development. Requires Python 3.11+ and DocFX. ```bash python build-docs.py --serve ``` -------------------------------- ### Detect Databricks ODBC Driver Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/CSharpScripts/Advanced/script-create-databricks-relationships.md This snippet checks for the presence of Databricks or Simba Spark ODBC drivers in common installation paths. It displays an error message and exits if no driver is found, guiding the user to download and install the necessary driver. ```csharp ScriptHelper.WaitFormVisible = true; // auto-detect Databricks ODBC driver string driverPath; string newDriverPath = @"C:\Program Files\Databricks ODBC Driver"; string legacyDriverPath = @"C:\Program Files\Simba Spark ODBC Driver"; if (System.IO.Directory.Exists(newDriverPath)) { driverPath = newDriverPath; } else if (System.IO.Directory.Exists(legacyDriverPath)) { driverPath = legacyDriverPath; } else { ScriptHelper.WaitFormVisible = false; Interaction.MsgBox( @"No Databricks ODBC driver found.\n\nPlease install the Databricks ODBC Driver from:\nhttps://www.databricks.com/spark/odbc-drivers-download\n\nExpected installation paths:\n " + newDriverPath + "\n " + legacyDriverPath, MsgBoxStyle.Critical, "ODBC Driver Not Found" ); return; } ``` -------------------------------- ### Build All Languages and Serve Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/README.md Builds documentation for all available languages and serves it using the Azure Static Web Apps CLI. Requires Python 3.11+, DocFX, and Azure Static Web Apps CLI. ```bash python build-docs.py --all swa start _site ``` -------------------------------- ### TE3 Edition-Specific Feature Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/APPLIES_TO_EXAMPLES.md This example demonstrates how to specify feature availability for different editions within Tabular Editor 3, starting from version 3.15.0. It shows partial support for the Business edition and full support for the Enterprise edition, while TE2 and TE3 Desktop editions are not supported. ```yaml --- uid: example-enterprise-feature title: Enterprise Feature author: Your Name updated: 2025-11-04 applies_to: products: - product: Tabular Editor 2 none: true - product: Tabular Editor 3 since: 3.15.0 editions: - edition: Desktop none: true - edition: Business partial: true note: "Limited to 10 objects" - edition: Enterprise full: true --- ``` -------------------------------- ### TE3 Only Feature Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/APPLIES_TO_EXAMPLES.md This snippet shows how to define a feature that is only available in Tabular Editor 3, starting from version 3.18.0. It explicitly marks Tabular Editor 2 as not supported. ```yaml --- uid: example-feature title: New Feature author: Your Name updated: 2025-11-04 applies_to: products: - product: Tabular Editor 2 none: true note: "Not available in TE2. Use TE3 for this feature." - product: Tabular Editor 3 full: true since: 3.18.0 --- ``` -------------------------------- ### Show, Path, Init, and Set CLI Configuration Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Commands to view and manage CLI configuration settings and TE3 path overrides. Use 'show' to display all settings, 'paths' for resolved TE3 file paths, 'init' to create default configuration, and 'set' to modify specific settings. ```bash te config show # Display all settings te config paths # Resolved TE3 file paths te config init # Create default config te config set autoFormat true ``` -------------------------------- ### Complex Partial Support Scenario Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/APPLIES_TO_EXAMPLES.md This example demonstrates a complex scenario with partial support for Tabular Editor 2 and edition-specific partial/full support for Tabular Editor 3 features starting from version 3.12.0. ```yaml --- uid: example-complex title: Complex Feature author: Your Name updated: 2025-11-04 applies_to: products: - product: Tabular Editor 2 partial: true note: "Requires manual scripting workaround" - product: Tabular Editor 3 since: 3.12.0 editions: - edition: Desktop partial: true note: "Read-only mode" - edition: Business full: true - edition: Enterprise full: true --- ``` -------------------------------- ### Run a Simple "Hello World" Script Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/getting-started/cs-scripts-and-macros.md This is a basic script to verify that your C# scripting environment is set up correctly. It displays a message in the output window. ```csharp Info("Hello world!"); ``` -------------------------------- ### Remove Metric View Dimensions Referencing a Specific Table Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/how-tos/semantic-bridge-remove-object.md Remove Metric View dimensions whose expressions start with a specific table prefix. This is an illustrative example and may not cover all edge cases for complex expressions. ```csharp var view = SemanticBridge.MetricView.Model; var sb = new System.Text.StringBuilder(); b.AppendLine($"Dimensions before: {view.Dimensions.Count}"); var toRemove = view.Dimensions .Where(d => d.Expr.StartsWith("date.")) .ToList(); foreach (var dim in toRemove) { view.Dimensions.Remove(dim); sb.AppendLine($"Removed: {dim.Name} ({dim.Expr})"); } sb.AppendLine($"Dimensions after: {view.Dimensions.Count}"); Output(sb.ToString()); ``` -------------------------------- ### Build All Languages (Default) Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/README.md Builds documentation for all available languages. This is the default behavior when no specific language or serve option is provided. ```bash python build-docs.py ``` -------------------------------- ### Complete Import Workflow Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/how-tos/semantic-bridge-import.md Demonstrates a full workflow: loading a Metric View, validating it, and importing it to a tabular format with detailed diagnostic reporting. Requires setup for Metric View loading and Azure Databricks connection details. ```csharp var sb = new System.Text.StringBuilder(); // Load the Metric View SemanticBridge.MetricView.Load("C:/MetricViews/sales-metrics.yaml"); var view = SemanticBridge.MetricView.Model; sb.AppendLine("METRIC VIEW SUMMARY"); sb.AppendLine("-------------------"); sb.AppendLine($"Source: {view.Source}"); sb.AppendLine($"Joins: {view.Joins?.Count ?? 0}"); sb.AppendLine($"Dimensions: {view.Dimensions.Count}"); sb.AppendLine($"Measures: {view.Measures.Count}"); sb.AppendLine(""); // Validate first var validationDiags = SemanticBridge.MetricView.Validate().ToList(); sb.AppendLine("VALIDATION"); sb.AppendLine("----------"); sb.AppendLine($"Issues: {validationDiags.Count}"); sb.AppendLine(""); // Import var success = SemanticBridge.MetricView.ImportToTabular( Model, "your-workspace.azuredatabricks.net", "/sql/1.0/warehouses/abc123def456", out var importDiags ); sb.AppendLine("IMPORT RESULT"); sb.AppendLine("-------------"); sb.AppendLine($"Success: {success}"); sb.AppendLine($"Diagnostics: {importDiags.Count}"); sb.AppendLine(""); if (importDiags.Count > 0) { sb.AppendLine("Import issues:"); foreach (var diag in importDiags) { sb.AppendLine($" [{diag.Severity}] {diag.Message}"); } } Output(sb.ToString()); ``` -------------------------------- ### UI Setup for Conversion Dialog Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/CSharpScripts/Advanced/script-convert-dlol-to-import.md Sets up the user interface elements for a dialog box, including labels, text boxes for database and schema names, and buttons for confirmation and cancellation. It also includes validation logic to enable the OK button only when all required fields are filled. ```CSharp // Database layout.Controls.Add(new Label { Text = "Lakehouse/Warehouse Name:", Padding = new Padding(0, 20, 0, 0), AutoSize = true }); DatabaseName = new TextBox { Width = 800, Text = db }; layout.Controls.Add(DatabaseName); // Schema (required) layout.Controls.Add(new Label { Text = "Schema:", Padding = new Padding(0, 20, 0, 0), AutoSize = true }); Schema = new TextBox { Width = 800, Text = schema }; layout.Controls.Add(Schema); // Buttons var panel = new FlowLayoutPanel { FlowDirection = FlowDirection.RightToLeft, Dock = DockStyle.Fill, AutoSize = true, Padding = new Padding(0, 20, 0, 0) }; okButton = new Button { Text = "OK", DialogResult = DialogResult.OK, AutoSize = true, Enabled = false }; var cancel = new Button { Text = "Cancel", DialogResult = DialogResult.Cancel, AutoSize = true }; panel.Controls.AddRange(new Control[] { okButton, cancel }); layout.Controls.Add(panel); AcceptButton = okButton; CancelButton = cancel; // Only enable OK when all three fields are non-empty SqlEndpoint.TextChanged += Validate; DatabaseName.TextChanged += Validate; Schema.TextChanged += Validate; Shown += (s,e) => Validate(s,e); } private void Validate(object sender, EventArgs e) { okButton.Enabled = !string.IsNullOrWhiteSpace(SqlEndpoint.Text) && !string.IsNullOrWhiteSpace(DatabaseName.Text) && !string.IsNullOrWhiteSpace(Schema.Text); } } ``` -------------------------------- ### Using TE CLI Commands in Interactive Mode Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-interactive.md Inside an interactive session, you can use most `te` subcommands without the `te` prefix. This example shows listing tables, getting a specific column, running a DAX query, and performing a best practice analysis. ```bash ls tables get "Sales/Revenue" -q expression query -q "EVALUATE TOPN(5, 'Sales')" bpa run --fail-on error ``` -------------------------------- ### Execute Multiple Tabular Editor Commands in Azure DevOps Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/Command-line-Options.md When running multiple Tabular Editor commands sequentially in an Azure DevOps pipeline, use 'start /B /wait' to ensure proper execution and output piping. This example demonstrates deploying two different models. ```shell start /B /wait TabularEditor.exe "C:\Projects\My Model\Model.bim" -D ssasserver Finance -O -C -P -S -V -E -W start /B /wait TabularEditor.exe "C:\Projects\Sales\Model.bim" -D ssasserver Sales -O -C -P -S -V -E -W ``` -------------------------------- ### Complete Example: Validate Metric View Contextual Rules Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/how-tos/semantic-bridge-validate-contextual-rules.md This C# snippet demonstrates how to create a Metric View with naming conflicts, define custom validation rules for measure names, and run the validation process. It includes setup for rules like 'measureNotDimensionRule' and 'noDuplicateMeasureRule', and outputs the validation diagnostics. ```csharp using MetricView = TabularEditor.SemanticBridge.Platforms.Databricks.MetricView; // Create a Metric View with naming conflicts SemanticBridge.MetricView.Deserialize(""" version: 0.1 source: sales.fact.orders dimensions: # 'revenue' is used as both a dimension and measure name - name: revenue expr: source.revenue - name: quantity expr: source.quantity - name: order_date expr: source.order_date measures: # measureNotDimensionRule violation - same name as dimension - name: revenue expr: SUM(source.revenue) # noDuplicateMeasureRule violation - 'total_quantity' appears twice - name: total_quantity expr: SUM(source.quantity) - name: total_quantity expr: COUNT(source.order_id) # This one is fine - name: order_count expr: COUNT(source.order_id) "); // Define contextual rules var measureNotDimensionRule = SemanticBridge.MetricView.MakeValidationRule( "measure_not_dimension_name", "naming", (measure, context) => context.DimensionNames.Contains(measure.Name) ? [context.MakeError($"Measure '{measure.Name}' has the same name as a dimension")] : [] ); var noDuplicateMeasureRule = SemanticBridge.MetricView.MakeValidationRule( "no_duplicate_measures", "naming", (measure, context) => context.MeasureNames.Contains(measure.Name) ? [context.MakeError($"Measure '{measure.Name}' is defined more than once")] : [] ); // Run validation var diagnostics = SemanticBridge.MetricView.Validate([ measureNotDimensionRule, noDuplicateMeasureRule ]).ToList(); // Output results var sb = new System.Text.StringBuilder(); sb.AppendLine("CONTEXTUAL VALIDATION RESULTS"); sb.AppendLine("-----------------------------"); sb.AppendLine(""); sb.AppendLine($"Found {diagnostics.Count} issue(s):"); sb.AppendLine(""); foreach (var diag in diagnostics) { sb.AppendLine($"[{diag.Severity}] {diag.Message}"); } Output(sb.ToString()); ``` -------------------------------- ### Initialize Macros File Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Creates an empty `MacroActions.json` file at the configured path. Use `--force` to overwrite if the file already exists. ```bash te macro init ``` -------------------------------- ### Silent Installation with AI Assistant Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/getting-started/installation.md To include the AI Assistant feature during silent installation, specify ADDLOCAL=MainFeature,AIAssistant. The AI Assistant is not installed by default. Ensure MainFeature is included when using ADDLOCAL. ```powershell msiexec /i TabularEditor..x64.Net8.msi /qn /norestart ADDLOCAL=MainFeature,AIAssistant /l*v C:\Temp\TE3_install.log ``` -------------------------------- ### Install 32-bit Excel ODBC Driver Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/how-tos/importing-tables-from-excel.md Use this command to install the 32-bit Excel ODBC driver when a 64-bit version of Office is already installed. This is a prerequisite for Tabular Editor 2.x to connect to Excel files. ```shell aceredist.msi /passive ``` -------------------------------- ### Initialize BPA Rules File Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Creates an empty BPA rules file. Use the `--force` flag to overwrite an existing file. The target file path can be specified using `--rules-file`. ```bash te bpa rules init ``` ```bash te bpa rules init --rules-file ./MyRules.json ``` ```bash te bpa rules init --force ``` -------------------------------- ### Infinite Loop Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/csharp-scripts.md An infinite loop in a script will cause Tabular Editor to become unresponsive. This example demonstrates such a loop. ```csharp while(true) {} ``` -------------------------------- ### Initialize New Semantic Model Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Create a new, empty semantic model at the specified local path. ```bash te init ./new-model ``` -------------------------------- ### Initialize Tabular Editor CLI Configuration Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-config.md Creates a default configuration file for the Tabular Editor CLI. Use the `--force` flag to overwrite an existing configuration file. ```bash te config init # Create config at TE_CONFIG (or ~/.config/te/config.json) te config init --force # Overwrite existing config ``` -------------------------------- ### Check Tabular Editor CLI Version Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-install.md Verify the installed version of the Tabular Editor CLI. This is a basic check to ensure the CLI is installed correctly. ```bash te --version ``` -------------------------------- ### Example of a Populated Calculation Group Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/kb/bpa-calculation-groups-no-items.md This example shows a 'Time Intelligence' calculation group after it has been populated with calculation items, demonstrating the 'After Fix' state. ```plaintext Calculation Group: Time Intelligence Items: - Current Period: SELECTEDMEASURE() - Year-to-Date: CALCULATE(SELECTEDMEASURE(), DATESYTD('Date'[Date])) - Prior Year: CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date])) ``` -------------------------------- ### Build Documentation for Specific Languages Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/README.md Builds documentation for specified languages. Use `--lang` followed by space-separated language codes. ```bash python build-docs.py --lang en ``` ```bash python build-docs.py --lang es zh ``` -------------------------------- ### Find Text and Get Expressions Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-commands.md Finds objects containing 'CALCULATE' in their expressions, outputs only paths, and pipes them to `te get` to retrieve the full expression. ```bash te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -q expression ``` -------------------------------- ### Run Best Practice Analyzer and Output as JSON Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-automation.md Execute the Best Practice Analyzer (BPA) using the `bpa run` command and set `--output-format json` for machine-readable analysis results. This facilitates automated validation checks. ```bash te bpa run --output-format json ``` -------------------------------- ### Silent Installation of Tabular Editor 3 Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/getting-started/installation.md Use this command for a silent installation without a user interface or reboot. The log file will be created at C:\Temp\TE3_install.log. ```powershell msiexec /i TabularEditor..x64.Net8.msi /qn /norestart /l*v C:\Temp\TE3_install.log ``` -------------------------------- ### Build Command for New Language Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/README.md Use this command to generate configurations and build the documentation after adding a new language. This ensures the language is dynamically included in the language picker. ```bash python build-docs.py --all ``` -------------------------------- ### Show All CLI Configuration Settings Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/te-cli/te-cli-config.md Display all current Tabular Editor CLI settings. Use '--output-format json' for machine-readable output. ```bash te config show # Display all settings te config show --output-format json # Machine-readable ``` -------------------------------- ### Configure AI Assistant with Ollama Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/ai-assistant.md Set up the AI Assistant to use a local LLM hosted by Ollama. Ensure Ollama is installed, a model is pulled, and the server is running. ```text 1. Download and install Ollama 2. Pull a model, for example: `ollama pull llama3.1` 3. Start the Ollama server (it runs automatically after installation, by default on port 11434) 4. In Tabular Editor, go to **Tools > Preferences > AI Assistant > AI Provider** 5. Set **Choose provider** to **Custom (OpenAI-compatible)** 6. Set **Service Endpoint** to `http://localhost:11434/v1` 7. Set **Model name** to the model you pulled (e.g. `llama3.1`) 8. The **API Key** field can be set to any non-empty value (e.g. `ollama`) — Ollama does not require authentication, but the field cannot be left blank ``` -------------------------------- ### Deprecated Feature Example Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/APPLIES_TO_EXAMPLES.md This example shows how to mark a feature as deprecated in Tabular Editor 3. It is available from version 3.0.0 up to 3.22.0, with a note indicating its deprecation in 3.23.0. ```yaml --- uid: example-deprecated-feature title: Deprecated Feature author: Your Name updated: 2025-11-04 applies_to: products: - product: Tabular Editor 2 full: true - product: Tabular Editor 3 full: true since: 3.0.0 until: 3.22.0 note: "Deprecated in 3.23.0. Use the new API instead." --- ``` -------------------------------- ### Example C# Script File Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/references/supported-files.md A sample C# script file for Tabular Editor 3, demonstrating how to create sum measures. These scripts can be saved as .csx files. ```csharp // This script creates sum measures for each table in the model. foreach(var t in Model.Tables) { // Create a new measure for the sum of a column, if it doesn't already exist if(t.Measures.Contains("Sum of " + t.Name)) continue; var measure = t.AddMeasure("Sum of " + t.Name); measure.Expression = "SUM(" + t.Name + "[)"; } // Save the script to a .csx file for reuse. // You can also save it as a MacroAction. ``` -------------------------------- ### Find Columns Not Starting with Table Name Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/using-bpa-sample-rules-expressions.md Applies directly to columns, this rule checks if a column's name does not start with its parent table's name. ```Dynamic LINQ not Name.StartsWith(Table.Name) ``` -------------------------------- ### Configure AI Assistant with LM Studio Source: https://github.com/tabulareditor/tabulareditordocs/blob/main/content/features/ai-assistant.md Set up the AI Assistant to use a local LLM hosted by LM Studio. Ensure LM Studio is installed, a model is pulled, and the server is running in OpenAI-compatible mode. ```text 1. Download and LM Studio 2. Pull a model. Either through the model search page on the left panel or the CLI. For example: `lms get lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF` 3. Start the LM Studio server. Either through the developer page on the left panel or through the CLI. for example `lms server start` Note, you will have to configure it to use OpenAI compatible mode. Additionally, you may have to change the default context size to be over 100,000 tokens. 4. In Tabular Editor, go to **Tools > Preferences > AI Assistant > AI Provider** 5. Set **Choose provider** to **Custom (OpenAI-compatible)** 6. Set **Service Endpoint** to `http://localhost:1234/v1` 7. Set **Model name** to the model you pulled (e.g. `lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF`) 8. The **API Key** field can be set to any non-empty value (e.g. `lms`) — LM Studio does not require authentication, but the field cannot be left blank ```