Skip to main content

The editor

New to Legend Cube? Take the tour, in the ☰ menu at the top left or on an empty cube's canvas: it walks through the editor one part at a time, on an example when the cube is empty.

The editor below shows the example Top customers by orders (Examples, then Northwind): it joins orders to customers, counts each customer's orders and keeps the ten customers with the most. The query is on top, as a graph of steps; its rows are below.

The Legend Cube editor, its parts numbered

Click the image to see it full size.

The palette​

  1. Sources: where the rows come from: a database table, a data product, an ingest data set, a function or a service. Click one to pick it, or drop it on the canvas.
  2. Steps: each works on the rows of the step before it. Click one to add it after the selected step, or drop it on the canvas; drop it on a step to add it after that step. A greyed-out step can't be added here; hover over it to see why, e.g. a database without JSON functions.

The header​

  1. Cube: New starts an empty cube, Import opens a cube from its spec, Import Pure reads a Pure query into steps (checked as you type: its border turns green once Cube reads it and the engine compiles it), and Export shows this cube's spec, to copy or download.
  2. Add Items: the palette's sources and steps, as a menu.
  3. Examples: ready-made cubes on sample data, to try things out.
  4. Undo and Redo: every change, opening an example included (Ctrl+Z and Ctrl+Shift+Z, or Cmd on a Mac).
  5. Show Pure: the Pure query that runs, up to the output step.
  6. Hide graph: more room for the results; Show graph brings it back.

The graph​

  1. A step: click it to edit it. Its editor opens beside it (see A step's editor, and each step's page under Steps).
  2. Output: marks the output step, the step Run Query runs up to. A step's menu and editor have Set as output to move it.
  3. Zoom in, zoom out and fit the graph to the view.

The results​

  1. Server-side or Local: with Server-side, each sort and drill-down in the grid runs on the engine, over every row of the query; with Local, the grid groups, pivots and filters the rows already fetched, in the browser.
  2. How many rows came back, and how long the run took.
  3. Show SQL: the SQL the run sent to the database.
  4. Run history: the latest runs, fetches and exports, each with its SQL.
  5. Rows and Run Query: Run Query (F9) runs the query up to the output step and shows its rows; Rows caps how many come back. While the query runs, the button is Stop.
  6. A column's menu (⋮): sort, pin, autosize, choose the columns shown, or reset them. Right-click a cell for more: drill down by its column; sort, group or filter by it, as a new step; format a number column; copy; or export the rows. See The results.

A step's editor​

Click a step on the graph to open its editor. This is the Group step's:

The Group step's editor, its parts numbered

  1. The step's kind, and its id.
  2. ?: hover over it to see what the step does.
  3. Set as output: makes this the output step, so Run Query runs up to it and shows its rows.
  4. Close the editor.
  5. None: untick every group column (one row for all the rows).
  6. The columns to group by.
  7. Cancel the changes, or Apply them to the cube.

Where an editor lists columns, each shows its type as an icon: # a number, Tт text, a calendar a date or a date and time, a clock a time, a toggle true or false, a list an enumeration, a tree JSON. Point at the icon for the type in words, such as Whole number, optional, and the exact type. An optional column can be empty. A source's column table names each type in words.