The Data Apps Conference
A yellow arrow pointing to the right.
A yellow arrow pointing to the right.
Team Sigma
January 31, 2025

SQL to Sigma – 5 Tips for Getting Started

January 31, 2025
SQL to Sigma – 5 Tips for Getting Started

So you’re making the switch to Sigma but want to keep your SQL reports? We hear you. Sigma is designed to give both SQL lovers and spreadsheet aficionados unparalleled access to their data. Sigma will bring new possibilities to your team without you ever having to give up the parts of SQL you love. We have the rich features expected from a modern development environment, along with a familiar spreadsheet experience backed by the full power of SQL.

To help you get started, we’ve put together a few tips for your transition. Check them out!

1. Write code with the SQL editor in Sigma

Do you have pages of SQL queries saved that get the results you need from the data warehouse? Are you more comfortable exploring data with SQL? Then Sigma's SQL Editor is for you. The SQL Editor offers a first-class experience for writing SQL, while letting you smoothly transition to Sigma's visual interface to share and collaborate with coworkers.

SQL workbook elements

SQL-based workbook elements bring your custom SQL queries directly into Sigma dashboards and reports. They let you utilize existing SQL expertise while benefiting from Sigma's visualization capabilities. Your results appear as standard Sigma elements that can be formatted, visualized, and shared with non-technical colleagues. With support for workbook controls, you can create dynamic, interactive dashboards that respond to user input while maintaining the precision of hand-crafted SQL.

Key SQL editor features

  • Toggle between the data element view and the inline SQL editor
  • Format SQL with one click for better readability
  • Find and replace functionality with keyboard shortcuts

The SQL Editor brings context to data exploration. You can preview data from tables in the same window where you write SQL queries. Autocomplete functionality ensures you target the correct table or column. Plus, there's a history of every SQL query you run, letting you quickly reference old work.

2. Build visualizations

Sigma workbooks allow you to build charts on top of your SQL queries. It allows you to visualize your data while staying connected to the cloud data warehouse.

Build the most common chart types, including line charts, map charts, scatter plots, pie charts, bar charts, grouped bar charts, and combination charts with bars and lines. You can also create table visualizations such as pivot tables, tables, and the ‘big number’ charts customized to match your company’s style.

Visualizations go beyond the basic chart types. Drill-down charts guide users through data. And parameters pass through user-entered information to the charts. Sigma has a full suite to build the visualizations that best communicate your data

3. Join data visually

Sigma workbooks allow you to visually join data from various sources, including tables, SQL queries, and uploaded CSV files. Sigma lets you create and preview the four most common SQL joins visually. Create a left, right, inner, or full outer joins using Sigma’s interface. You can preview the results of your join to confirm it is what you expect.

Sigma also has a unique join type called the lookup join. This functions like VLOOKUP in Excel, and prevents fanouts. The lookup join searches for matches in data similarly to a left join. If there is more than one match, rather than adding rows, the lookup join returns an asterisk. This means that the number of rows present in a table will not change because of a lookup join.

These visual joins within workbooks can handle complex SQL join logic, including multiple join keys and joins based on hidden columns. You can join data from different workbooks or directly from underlying tables, enabling flexible data integration. This allows you to create data models in different workbooks, and then combine them as needed.

4. Create dynamic SQL with workbook controls

Want to make your SQL queries respond to user input? Sigma's workbook controls let you build interactive reports without writing complex code. By referencing control values directly in your SQL statements, you can create dashboards that adapt instantly to changing business questions.

With a simple syntax using double curly brackets {{control-id}}, you can incorporate dropdown selections, date ranges, text inputs, and more into your SQL queries. This means the same report can answer different questions depending on what filters users select. For example, you might create a sales dashboard where users choose which regions to analyze, and your SQL automatically adjusts to show just those areas.

The flexibility of controls allows you to build sophisticated logic into your reports. You can create conditions like "show all results if nothing is selected" or "filter between these two dates" to make your dashboards more intuitive for business users. This powerful feature bridges the gap between technical SQL capabilities and business-friendly interfaces, making your data more accessible while maintaining the precision of your SQL queries.

5. Collaborate with business experts

Sigma workbooks make sharing the results of a SQL query easy. It also makes the work you do creating a SQL query reusable. Rather than running a query and sending the resulting CSV file to business users manually every time they need updated data, you can share a Sigma workbook with them once. From there, they can self-serve as needed using the Sigma interface. It lets them build the analysis and visualizations that matter most to them in an environment that always keeps their data up to date.

Scheduled reports email consumers links to the workbooks that contain their data or even exports of up to 100k rows of data.

Sigma’s environment caters to both SQL programmers and spreadsheet users, giving companies a single place for everyone to work. Rather than combating shadow IT with a suite of separate tools, Sigma provides a centralized data hub where everyone can utilize the platform comfortably.

Whether you're writing queries in the SQL Editor, integrating SQL elements into dashboards, or building dynamic, user-friendly reports, Sigma ensures a seamless transition. 

Ready to get started? Dive into Sigma today and see how it transforms how you work with data.

THE ULTIMATE KPI PLAYBOOK