Commission queries
These SQL queries let you check your own commission or bonus number. The rules behind each number are on the commissions page.
Before you start
- Open the SQL editor.
- Paste a query and change
you@posthog.comto your email. - Run it. You don't need to change the date.
Every query picks the quarter for you:
| Query uses | Quarter | Date in the query |
|---|---|---|
| Live data | This quarter | toStartOfQuarter(today()) |
| A snapshot | Last quarter | toStartOfQuarter(today() - INTERVAL 3 MONTH) |
To look up a different quarter, replace the date with the quarter's first day, for example toDate('2026-04-01') for Q2 2026.
Use live data for this quarter only. Live views rebuild from today's data, so a past quarter can drift from what you were paid. For past quarters, use the snapshot queries. Snapshots start in Q3 2026.
Ratios such as attainment and nrr are decimals: 1.2 means 120%.
Views
All views are in the RevOps folder of the SQL editor. Each view's header comment and column descriptions explain the rule it applies, so read them before writing your own query.
| View | Data | One row per | Filter to yourself |
|---|---|---|---|
| comp_tae_quota_lines | Live | TAE credit line | quarter_start, tae_email |
| comp_tam_payout_lines | Live | TAM payout line (one monthly invoice or one annual contract) | quarter_start, tam_email |
| comp_bdr_sqo_lines | Live | SQO | quarter_start, bdr_email |
| comp_account_lines_live | Live | Account line per quarter, every team | quarter_start, team, person_email |
| comp_annual_deals | Live | Annual contract | opportunity_id |
| comp_quotas | Live | Person per quarter | team, quarter_start, email |
| comp_tam_book | Live | TAM assignment per quarter | quarter_start, tam_email |
| comp_quarters | Live | Quarter | quarter_label |
| comp_account_snapshots | Snapshot | Account line per quarter | quarter_start, team, person_email |
| comp_quota_snapshots | Snapshot | Person per quarter | quarter_start, team, person_email |
Three things to know:
- Always filter by
team. Some people have rows for more than one team. comp_amounthas a different unit for each team: USD for TAE and TAM, SQOs for BDR, and ARR for CSM. Never add it across teams.- The
detailscolumn holds JSON. Read one key withJSONExtractString(details, 'rule_applied').
Everyone
My quota this quarter
- Use it when – you want to know your quota
- Data – live, this quarter
- Returns – one row per team you're on
quarter_quota is in dollars for TAEs, TAMs, and TAM leads, and in SQOs for BDRs. A blank quota means your row on the quota sheet isn't filled in yet. Ask in #team-revops.
My result for last quarter
- Use it when – you want the number you were paid on
- Data – snapshot, last quarter
- Returns – one row per team, with your result in that team's unit
| Team | result | attainment_or_nrr |
|---|---|---|
| TAE | Your credit | Credit ÷ quota |
| BDR | Your SQOs | SQOs ÷ quota |
| TAM | Your payout in dollars | Blank. TAMs have no attainment. |
| CSM | Your counted ARR | Your NRR: counted ARR ÷ base ARR |
TAM leads don't appear here yet. Use the dashboard tile. See TAM leads.
My adjustments
- Use it when – you want to see manual changes made to your lines
- Data – the adjustments tab of the quota sheet
- Returns – one row per adjustment credited to you
This covers TAE, TAM, and BDR adjustments. See adjustments for what each action does.
Live versus snapshot for my lines
- Use it when – your dashboard and your paid number don't match
- Data – live and snapshot, last quarter
- Returns – only the lines that differ
No rows means the two match. You're paid from the snapshot. If a difference looks wrong, post it in #team-revops.
Why a line paid what it paid
- Use it when – you want the rule behind each line from last quarter
- Data – snapshot, last quarter
- Returns – one row per line
For a TAM line, read exclusion_reason from details the same way.
TAE
My deals this quarter
- Use it when – a deal is missing, or you want to see how its credit was calculated
- Data – live, this quarter
- Returns – one row per annual contract or monthly-paying customer credited to you
| Column | What it tells you |
|---|---|
credit | What this deal adds to your quota credit |
at_risk_credit | The part of credit that's clawed back if the invoice isn't paid |
calc_note | The math, in one line |
reason | Why the deal is at risk, excluded, or counted in another quarter |
My attainment this quarter
- Use it when – you want your total credit and attainment so far
- Data – live, this quarter
- Returns –
total_credit,attainment
This should match the Attainment tile on the dashboard. If it doesn't, post both numbers in #team-revops.
My at-risk invoices
- Use it when – you want to chase unpaid invoices before the next cutoff
- Data – live, this quarter and last quarter
- Returns – one row per at-risk deal, soonest due first
Last quarter's at-risk deals are clawed back if they're still unpaid at the next cutoff.
My attainment by quarter
- Use it when – you want your paid attainment for every past quarter
- Data – snapshot, all quarters
- Returns – one row per quarter
If you have no quota row for a quarter, that quarter won't appear.
TAE leads
My team's attainment this quarter
- Use it when – you want your team's roll-up against your lead quota
- Data – live, this quarter
- Returns – your team's credit, lead quota, and attainment
Your team comes from the Salesforce role hierarchy: the TAEs whose role reports to yours. lead_quota is blank until your TAE lead row is on the quota sheet.
TAM
My payout lines this quarter
- Use it when – a customer pays less than you expect, or a line pays $0
- Data – live, this quarter
- Returns – one row per paid monthly invoice or annual contract in your book
If payout is $0, exclusion_reason tells you why:
| exclusion_reason | What it means |
|---|---|
left_book | The customer wasn't in a TAM book on the last day of the quarter |
invoice_before_book_date | The invoice is from before you were assigned the customer |
deal_before_book_date | No TAM was assigned to the customer on the close date |
not_opportunity_owner | You aren't the Salesforce opportunity owner |
not_on_tam_roster | You weren't on the TAM roster that quarter |
credit_covered | Paid with prepaid credit, account balance, or a credit note |
paid_out_of_band | Marked as paid outside Stripe |
overdue_invoice | The contract invoice was overdue at the cutoff |
contract_voided | A credit note canceled the contract |
My total payout this quarter
- Use it when – you want one number for this quarter so far
- Data – live, this quarter
- Returns – total payout, the at-risk part, and line counts
My at-risk invoices
- Use it when – you want to chase unpaid invoices before the next cutoff
- Data – live, this quarter and last quarter
- Returns – one row per at-risk line, soonest due first
My book this quarter
- Use it when – you want to check which accounts are in your book
- Data – live, this quarter
- Returns – one row per account, with assignment dates
in_book_at_quarter_end = 0 means the account left your book, so it won't pay this quarter. A blank account_name means the account has no payout line yet.
My payout by quarter
- Use it when – you want your paid total for every past quarter
- Data – snapshot, all quarters
- Returns – one row per quarter
The TAM total is a dollar payout. Don't divide it by quota.
TAM leads
Use the TAM Lead attainment (closed-won, PLS West / East) and TAM Lead detail: in and out of the closed-won total, by account tiles on the TAM Compensation (2026 Comp Model) dashboard. Snapshots don't include TAM lead lines yet, so there's no query for past quarters.
CSM
My accounts this quarter
- Use it when – you want to check your book account by account
- Data – live, this quarter
- Returns – one row per account counted in your NRR
base_amountis the account's base ARR.comp_amountis its counted ARR this quarter.statusis Counted or Grace.rule_appliedexplains a churn or a grace drop.
My NRR so far this quarter
- Use it when – you want one number for this quarter so far
- Data – live, this quarter
- Returns – accounts, base ARR, counted ARR, and NRR
My NRR by quarter
- Use it when – you want your paid NRR for every past quarter
- Data – snapshot, all quarters
- Returns – one row per quarter
base_arr is what your accounts actually spent last quarter. counted_arr is the ARR that counts this quarter.
CSM leads
My team's NRR this quarter
- Use it when – you want your team's combined NRR
- Data – live, this quarter
- Returns – one row per CS team (EU and NA)
Each CSM's team comes from the CS_name_email table, the same one the CSM dashboard uses. An unknown row means a CSM is missing from that table. Ask RevOps to add them.
BDR
My SQOs this quarter
- Use it when – you want to check every SQO is credited to you, and in which month
- Data – live, this quarter
- Returns – one row per SQO
Missing an SQO? Check the opportunity's lead source is Outbound, and that you logged an Outbound task on the account. If both are right, post it in #team-revops.
credit_source shows how the SQO was credited:
- Outbound lead task – By the rule
- Manual credit – By an adjustment
My attainment this quarter
- Use it when – you want your SQOs against quota so far
- Data – live, this quarter
- Returns – SQOs, quarterly quota, and attainment





