Docs/Advisors/Data Shaping

Data Shaping

Data Shaping is how you tell an advisor exactly what data to analyze and how to structure it. It transforms your raw database tables — which might have complex relationships and millions of rows — into a clean, focused dataset that's ready for AI analysis.

The Core Idea

Most business data lives across multiple tables. Your accounts are in one table, telemetry data in another, support tickets in a third. Data Shaping lets you join these tables together and aggregate the data so the advisor sees one row per entity — one row per account, one row per customer, one row per opportunity.

Before Data Shaping:

Your accounts table has 500 rows. Your telemetry table has 50,000 rows (multiple readings per account per day). The advisor would be overwhelmed.

After Data Shaping:

500 rows — one per account — each with the most recent telemetry reading, total support tickets, and latest NPS score pulled in from related tables.

Accessing Data Shaping

Data Shaping is Step 3 of the Advisor creation wizard. Navigate to Dashboard → Advisors → New Advisor and proceed through the Type and Data Sources steps to reach Data Shaping.

The Four Tabs

1. Primary Entity

Choose the main table that defines the grain of your analysis.

  • Data Source — Select your connected database
  • Table — Pick the primary table (e.g., accounts, opportunities, customers)
  • Key Column — Choose the unique identifier (e.g., id, account_id)
The key column determines what "one row per entity" means. If you choose the accounts table with id as the key column, you'll get one row per account ID in your final output.

Bring in data from other tables by joining them to your primary entity.

For each related table, configure:

  • Table — Which table to join
  • Join type — How to match rows:
- Left Join — Keep all primary rows, even if there's no match (most common) - Inner Join — Only keep rows that exist in both tables - Right Join — Keep all rows from the related table
  • Join condition — How the tables connect (e.g., accounts.id = telemetry.account_id)
You can add multiple related tables. For example, join both your telemetry table and your support tickets table to your accounts.

3. Columns

Select which columns to include and how to handle them.

For each column, you can configure:

  • Output name — Rename the column for clarity (e.g., seat_usage_percentLatest Usage)
  • Include in AI analysis — Toggle whether the AI sees this column when generating insights
  • Aggregation — For columns from related tables with one-to-many relationships, choose how to collapse multiple values into one:
AggregationWhat It DoesExample Use
Most RecentGets the latest value by a date columnCurrent usage reading
OldestGets the earliest value by a date columnFirst interaction date
SumAdds up all valuesTotal revenue
AverageCalculates the meanAverage deal size
CountCounts the rowsNumber of support tickets
Min / MaxSmallest or largest valueLowest score, highest amount
ArrayCollects all values into a listAll product names
ConcatenateJoins values into a comma-separated stringAll tag names as text
Tip: For time-series data (like daily telemetry readings), Most Recent is usually what you want — it gives you the current state rather than historical noise.

4. Preview

Test your configuration with live data before saving.

  • Click Run Preview to execute the shaped query against your database
  • See sample rows with AI-included columns highlighted
  • Click View SQL to see the generated query (useful for debugging)
  • Results typically load in under 2 seconds
Preview is your best friend — always check it before running a full advisor.

Notification Delivery Column

One special column configuration: the Notification Delivery dropdown. This maps a column containing email addresses to control who receives each insight via Slack.

For example, if your accounts table has an OWNER_EMAIL column containing the sales rep's email for each account, select it as the notification delivery column. When the advisor generates an insight about Account X, the insight will be delivered as a Slack DM to the person whose email matches OWNER_EMAIL for that account.

Requirements:
  • The column must contain email addresses
  • Those emails must match actual members in your Slack workspace
  • If an email doesn't match a Slack user, the insight is still created in the dashboard but won't be sent via Slack

Example: Account Expansion Advisor

Here's how you'd set up a data shaping configuration for finding expansion opportunities:

Primary Entity:
  • Table: accounts
  • Key Column: id
Related Tables:
  • license_telemetry — Left Join on accounts.id = license_telemetry.account_id
Columns:
ColumnSourceAggregationIn AI Analysis
Account IDaccounts.idNo
Account Nameaccounts.nameYes
Current Tieraccounts.tierYes
Latest Usagetelemetry.seat_usage_percentMost Recent (by date)Yes
Total Seatstelemetry.total_seatsMost Recent (by date)Yes
Owner Emailaccounts.owner_emailNo
Notification Delivery: Owner Email Result: One row per account showing their name, tier, latest seat usage, and seat count. Insights are delivered to each account's owner via Slack.

Tips

  • Start with just the primary table — Get that working, then add joins one at a time
  • Use meaningful output names — The AI reads these column names, so "Latest Usage %" is better than "col_7"
  • Only include columns the AI needs — Toggle off columns that are just for identification or delivery. Fewer columns = more focused analysis.
  • Check the Preview tab often — It's the fastest way to catch join issues or unexpected data
  • Watch your row counts — If your primary table has 100,000 rows, consider using advisor rules to filter before AI analysis