Visualizing Worksheet Data¶
This topic describes how to visualize your SQL worksheet results using charts in Snowsight. Charts transform your query results into visualizations that communicate logical relationships and lead to more informed decision making. Charts let you quickly identify and understand patterns and outliers in data.
Snowsight supports the following types of charts:
Bar charts
Line charts
Scatterplots
Heat grids
Scorecards
You can also visualize your data using dashboards.
Using Charts¶
To get started using charts, above the results table for a query, select Charts.
The first time you access charts for a query, Snowsight automatically generates a chart for you based on your results. Each query supports one type of chart at a time.
You can change chart types at any time and exercise granular control over the data in the chart.
This section gives a brief overview of how to navigate and use charts. This section includes examples and descriptions of the following interface elements:
Interface |
Description |
---|---|
Your chart, located at the bottom of the worksheet, lets you see a visual representation of your query results. Hover over the chart to view details about each data point. This example uses the line chart. The way the data is visualized depends on the type of chart you select. |
|
Use Chart Type, located to the right of the chart, to select the type of chart for your results:
|
|
Use the Data section, located to the right of the chart, to manage your chart columns:
|
|
When you select a column in the Data section, the column attributes appear. Use the column attributes to configure how data in that column is rendered in the chart. You can also remove the column from the chart. |
|
Use the Appearance section, located to the right of the chart, to style your chart. The available settings depend on the type of chart. |
The exact content of your charts depends on your results. To generate the examples in this topic, use the following query:
SELECT
COUNT(O_ORDERDATE) as orders, O_ORDERDATE as date
FROM
SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.ORDERS
WHERE
O_ORDERDATE = :daterange
GROUP BY
:datebucket(O_ORDERDATE), O_ORDERDATE
ORDER BY
O_ORDERDATE
LIMIT 10;
Charts and New Query Results¶
Your chart updates automatically as long as the columns used by the chart are available in the query results. If a column name changes, you must update the chart to use the new column name. Charts indicate any columns that cannot be found.
Aggregate and Bucket Data¶
Charts simplify grouping numbers, dates, and timestamps of more or less continuous values into various buckets. For example, suppose your query retrieves per-day data over a period of time. Without modifying your query, you can easily select a different bucket of time (e.g. weekly or monthly data) in the inspector panel to change the time dimension of the results displayed in the chart.
Charts can bucket by date, week, month, and year for date columns. For numeric columns, charts can bucket by integer values.
Charts use aggregation functions to determine a single value from multiple data points in a bucket. These functions are as follows:
average
count
minimum
maximum
median
mode
sum
Download Charts¶
Snowsight provides PNG-formatted files of charts.
To download a chart, in the upper-right corner of the chart, select Download Chart ().