To run these examples
- Log into Github
- press
.
(the period key) to run vscode - Install the Malloy Extension when prompted (or manually)
Often you want to limit the results to the top reusults. This example shows how to bucket everything else into an 'OTHER' bucket
Growth is this period minus last period divided by last period. Here is how you do it simply in Malloy
Malloy currently doesn't support rendering tables with totals, but you can simple compute them.
Malloy has the ability to escape grouping in a query. This is very useful for percent_of_total calculations among other things.
Malloy natively understands how to work with tables that have nested structs and arrays (including raw JSON) and makes easy to query and transform.
Take list of individual flights and map/reduce into individual aircraft sessions per day. Display their routes for each day on a map. Classic Map/Reduce.
When drawing an histogram, you need to figure out a proper bin size to group the data. This pattern dyamically computes bin sizing. The binning automatically adusts with in filtered and nesting situations.
Sometime data comes in with duplicates. We can base a query on a SQL Query to remove duplicates
Using DuckDB wwe can query from Web API endpoints. This example pulls from the github and runs some transformation queries against the results
Malloy has a special 'index' operator that produces a result that contains all the dimensional values in a graph weighed by whatever measure you think is important. The index can be built by reading the whole graph or sampling a subset of records. The index is useful in suggesting filters and for basic understanding of a data set and perhaps informing an LLM.