Qubit Docs العربية

Editing fields

You edit the model on the Semantic Layer page, in Build or in Code. Both change the same YAML document, and nothing takes effect until you save.

Business objects in Build

Under Business objects, click Add object, then open the object to fill in its fields:

  • Name: a lowercase id, such as orders. Metrics and joins refer to the object by this name. Renaming it in Build also updates the metrics and joins that point to it.
  • Database and Table: the table list comes from the connection's live schema. Not found in this database means the table is no longer there.
  • Primary key: the column that identifies one row. Counting rows and joining other objects to this one both need it.
  • Description: what one row represents, for example "One row per order." The Assistant reads it.
  • Certified: the assistant should prefer this: marks the object as the definition your team vouches for.
  • Dimensions: columns you want to split numbers by. Click Add, pick the Column, give it a Label, and set its Type: Category, Date or time, Number, Place, or Yes or no.
  • Connects to: joins to other business objects. Click Add, pick This column on this object, the object under Matches object, and its column under On column, which defaults to that object's primary key. Name the join under Call this link and set its Cardinality: Many to one, One to many, or One to one.

You need to choose a table before you add dimensions or joins, and a second business object before you add a join. The join's name is how metrics reach the other object's dimensions, for example store.region.

Remove this object removes the object and the metrics built on it from the document.

Metrics in Build

Under Metrics, click Add metric. Metric definitions describes each field.

Working in Code

Code shows the YAML document itself.

  • Use Insert to add a Database, Business object, Join, or Metric. Qubit asks for the details, places the new lines in the right section, and highlights them.
  • Press Ctrl+Space for suggestions as you type.
  • The Syntax guide tab describes every field.

If the YAML has a syntax error, Build cannot open it until you fix it in Code.

Some settings can only be written in Code, and an edit made in Build rewrites the document without them:

  • is_visible_to_ai: false on a dimension, which hides it from the Assistant
  • description_ar on a business object
  • join_type and description on a join
  • filters written as more than one all group

Comments are also dropped when you edit in Build. If you rely on any of these, make your changes in Code.

Checking and saving

  1. Click Check. Qubit validates the document against the live schema of each connection without saving anything.
  2. Fix any problems listed under the editor. Click a problem's line number to jump to it in Code. Errors block saving. Notes, such as a warning about a join across two databases, do not.
  3. Click Save. Qubit shows Review before applying, with what Will be created, Will be updated, and Will be removed.
  4. Click Confirm and save.

If the saved model changes while you are editing, for example because the Assistant saved a change, Qubit keeps your edits and shows a notice. Review the change list carefully before you save. Closing or reloading the tab with unsaved edits asks you to confirm.

Editing with the Assistant

Open the Assistant while you are on the Semantic Layer page. It suggests starting points such as Explain this model, Build a model from my data, Define a metric, and Connect related tables.

The Assistant can read the model, check it, and save additions and changes. It cannot save a change that removes anything from the model. When a change would remove something, it asks you to make that change in the editor.

To change the model, the Assistant needs the Metrics & semantic model capability, and you need the Owner or Admin role. See Capability toggles.