The Scenario
The data quality engineer got a report from the analytics team: the CUSTOMERS table has been returning weird results in some segments. Plan type distribution looks off. Country codes include values nobody recognizes. Status field has a handful of entries that don't match the documented enum.
You need to profile eight columns — country, plan_type, subscription_status, payment_method, and four others — to understand what's actually in there before you can write a quality check or file a bug report. The raw profiling output needs to live in a Google Sheet so you can share it with the analyst and the engineer who owns the table.
The bad version:
- Write a SELECT DISTINCT query for the first column, run it in Snowflake, read the results, and manually type the distinct values into the sheet.
- Repeat for each of the eight columns — eight separate queries, eight manual copy operations, eight opportunities to mis-transcribe a value.
- Format the sheet so each column's distinct values sit in a logical place, which takes another 20 minutes because the cardinalities are different and you have to decide on a layout.
Eight columns isn't a big number until you're doing it manually and you realize distinct value counts vary from 4 to 200 and now your layout decisions are falling apart.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It can query Snowflake for distinct values across multiple columns and write the profiling output directly into a structured layout in your sheet.
Paste this into the SheetXAI sidebar:
For each column name listed in column A of this sheet (8 rows), fetch a sample of distinct values from Snowflake table PROD.PUBLIC.CUSTOMERS and write the top 5 distinct values for each column into columns B–F on the same row
What You Get
- Column A unchanged (your 8 column names)
- Columns B–F populated with the top 5 distinct values for each column, one per cell on the same row as the column name
- If a column has fewer than 5 distinct values, the remaining cells in that row are left empty
- If a column name doesn't exist in the table, the row gets an error note in column B
What If the Data Is Not Quite Ready
You need distinct value counts alongside the values themselves
For each column in column A (8 rows), query Snowflake PROD.PUBLIC.CUSTOMERS for the top 5 distinct values and their occurrence counts — write each value and count as pairs into columns B–K on the same row (value in odd columns, count in even columns)
You want to profile columns across two tables with a join condition
Profile the distinct values of country, plan_type, and subscription_status in Snowflake PROD.PUBLIC.CUSTOMERS joined to PROD.PUBLIC.SUBSCRIPTIONS on customer_id — write one column per field with the top 5 distinct values in rows 2–6 and the field name in row 1
You need to flag any column where a specific disallowed value appears in the distinct set
For each column in column A, get distinct values from Snowflake PROD.PUBLIC.CUSTOMERS — write the top 5 values in columns B–F, and if any column's distinct values include 'UNKNOWN', 'NULL_STRING', or '' write 'QUALITY FLAG' in column G on that row
You need the full distinct value profile, value counts, and a cardinality summary all in one pass
Profile columns country, plan_type, subscription_status, and payment_method in Snowflake PROD.PUBLIC.ACCOUNTS — for each column write all distinct values and their row counts into this sheet with one column per field, then add a summary row at the top with the total distinct count per column, and flag any column with more than 500 distinct values as 'HIGH CARDINALITY' in a final summary row
One prompt covers the profiling, the count, the cardinality check, and the layout.
Try It
Get the 7-day free trial of SheetXAI and open the Google Sheet where your quality check list lives, then ask it to profile distinct values across those columns in Snowflake and write the results into the sheet. You can also explore running a cohort retention analysis or return to the Snowflake overview.
