Carrot (CQL)
Understanding CQL (Carrot): ChartHop's Formula Language
ChartHop has a built-in expression language called CQL, short for Carrot Query Language (we call it Carrot). It's the engine behind some of ChartHop's most powerful capabilities: searching, filtering, calculating, and displaying people data exactly the way your organization needs it. Once you get the hang of it, you'll start noticing it everywhere in the platform.
Where Carrot Lives
The great thing about Carrot is that the logic works the same no matter where you're writing it. Dashboards, forms, the org chart, data sheets, markdown profile tabs โ same expressions, just a slightly different wrapper depending on context. Learn it once and it clicks everywhere.
Where You're Working | How You Write It |
|---|---|
Dashboard charts (Advanced mode) | {{base / fieldCode1}} |
Form content blocks | {{formatMoney(base)}} |
Smart Calcs and Smart Buckets | Plain expression: base * fieldCode1 |
Data Sheet calculated columns | Plain expression: diffYears(startDate, today()) |
Markdown profile tabs / home page | {{ }} for values ยท {% %} for logic |
What Carrot Can Do
Calculate anything. Compa-ratio, tenure, weighted performance scores, prorated salary โ if the data lives in ChartHop, Carrot can work with it. A couple of quick examples:
Filter with real precision. Carrot is what powers search and filtering across the platform. Want every active manager in Engineering with more than three years of tenure? One expression handles it.
Label and categorize automatically. Smart Buckets use Carrot conditions to color-code employees across the org chart and data sheet. No manual work, no spreadsheets on the side.
Surface context right inside forms. One of our favorite use cases: embedding live Carrot expressions into review and comp forms so reviewers see everything they need without leaving the page.
Show or hide content based on data. In markdown tabs and the home page, Carrot's logic blocks let you control what people see based on their actual profile data.
A Few Things Worth Knowing
Carrot references fields by their field code, not their display name, so if a field gets renamed in ChartHop, you'll want to update any references manually. If a field might be empty, get in the habit of adding ?: 0 to your formula so it doesn't break on blank values. And when you're pulling historical data for reporting or baselines, use asOfPrimary rather than asOf โ it keeps draft scenario data out of the picture.
If you want to go deeper, the CQL Cheat Sheet has the full formula reference. And as always, your ChartHop admin or CSM is happy to help you get started.
