run('
sales
then keep where ([revenue] > 150)
then summarize [sold] as total([quantity]) by [region]
then sort [sold] descending
')| region | sold |
|---|---|
| East | 13 |
| West | 5 |
| North | 4 |
How much is there to learn? Here is the whole of it, on one page, before you meet any of it properly. The pipeline you just read used a handful of these words; every pipeline you will ever write uses words from this page and no others.
run('
sales
then keep where ([revenue] > 150)
then summarize [sold] as total([quantity]) by [region]
then sort [sold] descending
')| region | sold |
|---|---|
| East | 13 |
| West | 5 |
| North | 4 |
sales |>
keep(revenue > 150) |>
summarize(sold = total(quantity), by = region) |>
sort(descending(sold))| region | sold |
|---|---|
| East | 13 |
| West | 5 |
| North | 4 |
(sales
>> keep(col.revenue > 150)
>> summarize(sold = total(col.quantity), by = col.region)
>> sort(descending(col.sold)))| region | sold |
|---|---|
| East | 13 |
| West | 5 |
| North | 4 |
sales then keep where [revenue] > 150 then summarize [sold] as total([quantity]) by [region] then sort [sold] descending
One sentence, and it already drew on three of the five shelves below. The lists are asked from the engine while this page is built. So what you are reading is the vocabulary, not a summary of one.
The verbs, each a step that takes a table and gives a table back. The next chapters of this part carry the six that do most of the work. The rest arrive in the parts that own them.
`keep` · `pick` · `add` · `summarize` · `sort` · `take` · `take_last` · `join` · `add_rows` · `drop_duplicates` · `rename` · `drop_missing` · `fill_missing` · `add_combinations` · `lengthen` · `widen`
The aggregations, which collapse a group of rows to one answer. They live inside summarize, and inside add when a group’s answer should land on every row.
`total` · `average` · `median` · `smallest` · `largest` · `standard_deviation` · `first` · `last` · `unique_count` · `row_count` · `join_rows`
The windows, which answer once per row by looking along the other rows: a place, a running total, the value one row back.
`rank` · `row_number` · `running_total` · `previous` · `following` · `rolling` · `latest`
The scalar functions, one value in and one value out: text repairs, conversions, the parts of a date, one conditional companion.
`first_present` · `join_text` · `lower` · `upper` · `to_number` · `to_text` · `to_date` · `round_below` · `round_above` · `trim` · `replace_text` · `split_text` · `characters` · `between` · `remainder` · `year` · `month` · `day` · `weekday` · `hour`
The grammar words, the joints that say how the words on either side relate. Five of them travel between the verbs so often they get a chapter of their own at the end of this part.
`then` · `where` · `as` · `by` · `all_but` · `descending` · `in` · `is` · `not` · `and` · `or` · `yes` · `no` · `missing` · `unmatched` · `starts` · `ends` · `contains` · `name` · `value` · `kind` · `giving` · `when` · `otherwise` · `look_up` · `matching` · `any` · `every` · `with` · `ties`
That is all of it. There is no second list waiting after this one, no helper family, and no extra dialect on a cluster. A word that is not on this page is not in the grammar, and asking for one gets a refusal that names the nearest word that is. The count is the argument. A vocabulary this size can be met in a sitting and carried whole, and the rest of this book is those shelves taken down one or two words at a time, each with the design decision that put it there. When you want this page again as a reference, every word in the grammar is the same list with a map of where each word first runs.