Overview: Metric Builder for Snowflake


  1. Access Custom Metrics and Metric Builder for Snowflake
  2. Use the Metric Builder for Snowflake
  3. Create a Custom Snowflake Metric [Example]
  4. Add a Custom Snowflake Metric to a Databoard
  5. Additional Information

How to access Custom Metrics and Metric Builder for Snowflake

Navigate to  Metrics > Custom Metrics to access the Metric Builder for Snowflake. Click the green + New Custom Metric button and select your connected Snowflake Data Source from the Data Source drop-down list.

Metric Builder is available on the Professional and higher plans. Request a trial of Metric Builder by following these steps.

How to use the Metric Builder for Snowflake

Screenshot 2024-01-19 at 7.38.09 PM

  1. A) Custom Metric Name: Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving. 
  2. B) SQL: Construct query strings to access data from your Database using Structured Query Language (SQL). 
  3. Learn more about SQL here
  4. C) Aggregation Function: Select your Aggregation Function
  5. D) Data Type: Selecting the appropriate Data Type ensures that your Custom Metrics will be synced correctly in Databox. Learn more about Data Types here
  6. E) Preview Data: After clicking Preview data, a Data Preview of the Custom Metric will be displayed. Daily Metric values are displayed in this section, along with the total Metric values for the Date Range in bold at the bottom. You can view the Data Preview for different Date Ranges by clicking on the drop-down list at the top of the Data Preview. 
  7. F) Custom Metric Name: Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving. 
  8. G) Save: Save your Custom Metric. 

How to create a Custom Snowflake Metric [Example]

The Metric Builder for Snowflake is designed so you can directly enter SQL queries. For our example, we will use a Snowflake Data Source and create a Custom Metric that returns a list of Custom Names and their current Account Balance. 
  1. Navigate to   Metrics > Custom Metrics
  2. Click the green  + New Custom Metric button
  3. Select the appropriate Snowflake Data Source
  4. In order to accurately explain what this Custom Metric is reporting on, we'll name the Custom Metric "Customers by Balance"
  5. In the SQL field, we will enter the query below. A semicolon at the end of the query is not necessary
SELECT start_date AS date, name, balance FROM sample_data				

6. We will select Total Values as the Data Type. This selection is based on the way data is stored and updated in our database
7. Click Run query to generate a Data Preview of the Custom Metric

If you don’t see any data, double check your SQL query and try it directly in your Database. If no results are displayed there, an error exists in your query. You should also check to confirm that the Snowflake user has the necessary permissions to access the Database from Databox's public IP. 

8. Once we confirm that these are the results we're looking for, we'll click Save to save the Custom Metric

How to add a Custom Snowflake Metric to a Databoard

Learn how to add a Custom Metric to a Databoard here

Additional Information

  • Query results are limited to 10,000 rows. If you expect your query to return over 10,000 rows or if you're not sure how many rows will be returned, be sure to LIMIT the query. If you need more than 10,000 rows in order to successfully report on your Snowflake data in Databox, feel free to submit your request on our Roadmap here.
  • The query must contain a column named "Date." If you need to, use AS in your SELECT statement to satisfy this requirement
  • One column should always contain the Metric Value
  • "Null" values will not be recognized. Use a COALESCE function when needed. Learn more here.
  • You can get a "Query preview error" if value columns have decimal numbers. The value column needs to be casted to double the numeric type. According to Snowflake's documentation, "DOUBLE, FLOAT, DOUBLE PRECISION, and REAL columns are displayed as FLOAT, but stored as DOUBLE. Learn more about this in Snowflakes documentation here.
    • You should update your queries accordingly (using CAST()), and by doing this you will receive the data as expected.