Skip to content
ispyisail edited this page Nov 26, 2026 · 1 revision

Formula columns: a calculated column without writing SQL

A parts list or other nomenclature table is built from a query (see Building a nomenclature query). Adding a calculated column used to mean writing SQL. The formula builder lets you build it step by step: pick a field, a text, a number or an operation, and make things like "if the article is empty use the description", "quantity times two" or "label in capitals".

It is the Add formula column... button in the nomenclature query editor of a table. Hover the button for its tip: Add a column worked out from the others, without writing SQL. The query becomes a custom SQL query.


1. Using the builder

The button is also in Project β†’ Export to CSV, which uses the same builder.

The Formula column dialog with If empty, use another value: preferred value Article number, otherwise Textual description, and the SQL it makes

  1. Click Add formula column.... The Formula column dialog opens.
  2. Type a Column title (placeholder: Title of the column).
  3. Pick what the column is made of in the box below. The first box is a list of operations, grouped under headings. Depending on what you pick, the dialog shows a field list, a text box, a number box, or one box per input.
  4. An operation's inputs can be operations too: each input has its own list. Add an input and Remove the last input appear for operations that take a variable number of inputs (All of, Any of, Join values).
  5. The dialog shows The SQL this makes (read only). A line in red says what is wrong, for example Choose an operation. or The formula is nested too deeply (at most N levels).
  6. Add the column adds it to the query.

2. The operations

Group Operation What it gives
Values A field a column of this table's source
Fixed text text you type. Quotes and other punctuation are handled for you
A number a number you type
Nothing no value at all. To check for missing or blank text, use Is empty
Comparisons Equals, Differs from compare two values. If one is a number, they are compared as numbers
Greater than, At least, Smaller than, At most compare numbers. At least and At most count equal
Between two numbers the two limits count as inside
Text conditions Is empty, Is not empty true for nothing, empty text or text of only spaces / true when there is something besides spaces
Contains, Starts with, Ends with true when the text holds, begins or ends with the other text, whatever the case
Logic If... then... else the second value when the condition is true, the third otherwise
All of, Any of, Not true when every / at least one condition is true / the condition is false
Text functions If empty, use another value the first value unless it is empty, then the second (inputs Preferred value and Otherwise use)
Join values the values one after the other, with a separator you type between them
Replace text replaces every occurrence of the text to find
UPPER CASE, lower case turns the text into capitals / small letters
Remove surrounding spaces removes the spaces before and after
Numbers Add, Subtract, Multiply, Divide arithmetic on two numbers. Dividing by zero gives nothing, not an error
Round rounds to a number of decimal places

3. Examples

The field names stand for whichever columns the table's source offers in the field list.

You want Build
the article, or the description when the article is empty If empty, use another value: Preferred value = field article, Otherwise use = field description
quantity times two Multiply: Number = field quantity, Times = a number, 2
the label in capitals UPPER CASE: Text = field label
label and location with a dash between Join values with separator -, input 1 = the label field, input 2 = the location field

4. What it does to the query

  • The query becomes a custom SQL query, as if you had ticked the custom SQL box in the editor yourself. The column is added to it. No new data is saved in the project file beyond that query text.
  • Nothing typed reaches the query as SQL. Typed text and numbers are written as quoted literals, and a field must be one of the table's own columns, so SQL typed into the dialog is just text.
  • Nothing changes unless you use the button.

Idea from #1650, rewritten small: the original depended on a grouped-list layer and a saved-formula layer that are not part of this change. Added in #1703.


See also

Checked against build b49ce16c4 on 2026-11-27 (by hand: the screenshots and menu paths in the sections added on 2026-11-27 were taken on that build; the other details of those sections read from source).

Getting Started

Home

🌐 Languages β€” English Β· FranΓ§ais Β· Deutsch

Downloads

Windows without admin rights β€” the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors β€” wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal β€” limit the wires on a terminal, chain wiring instead of stars

Printing and exporting β€” paper, PDF, images, and what each path does differently

Linking elements β€” master, slave, terminal

PLC modules β€” I/O tables and linking a wire to a specific point

Using the element editor β€” drawing tools, saving, checks

Generic devices β€” a quick box symbol with terminals on any side, made by a wizard

Grid size and element size β€” why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference β€” what each settings page does

Saving and loading settings β€” your whole setup in one file, to copy or keep

Keyboard-only control β€” mouseless QET, and what still needs a mouse

Mouse modifiers β€” what Shift, Ctrl and Alt change while you drag

3D mouse β€” SpaceMouse pan, zoom and buttons

Aligning items β€” snap symbols back to the grid, or line them up

Drawing aids β€” dark mode, snap and grid step, crosshair, dimensions, the tape measure

Symbols already on the sheet β€” select the same symbols, replace them, show a T-junction as a dot, update placed copies from the collections

Symbol texts β€” place the texts at nine points, fixed or free size, format painter, title block cells, GOST ESKD, %T

Wiring tools β€” automatic connections, the Connections toolbar, chained folio reports, a cable across wires

Symbols and parts β€” edit several symbols, relay contact display, grouped parts list

Device types β€” what a device is made of: check, place and change its parts, Device Navigator

Project languages and checks β€” languages in a project, cell origin, duplicate labels, the Check panel

Reports and lists β€” project lists to CSV/PDF, tables on a folio, label-printer export, symbol list

Pictures on a sheet β€” labels, crop, transparency, what they cost in the file

Arcs and curved wires β€” the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items β€” select, move and copy several items as one

Finding your place on a sheet β€” go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items β€” hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster β€” place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech β€” keys, toolbar size and contents, the gesture ring

Managing collections β€” folders, writability, building your own shortlist

Templates β€” reusable multi-element blocks, placed by double-click or drag

Search & Replace β€” bulk property changes

Building a nomenclature query β€” the BOM/summary table builder

Formula columns β€” build a calculated column in a parts list without writing SQL

Linking wires across pages β€” sheet reports

Variables & formulas β€” %f, %{label}, sequences

Auto-numbering β€” schemes, sequences, freezing

Terminal strips β€” strips, levels, bridges

Connectors β€” plugs and sockets as terminal strips or head-with-pins devices, device types, pin check, spare-pin plans

Title block templates β€” the .titleblock format

Title block alignment β€” place a title block inside or outside the sheet, left, centred or right

Plants and locations β€” list, rename, copy a plant, suggestions

Designations and structure boxes β€” IEC 81346 names, structure boxes, ==/++ levels, folio groups, company prefixes

Revisions, document kinds and drawing standard β€” revision list and table, IEC 61355 document kind, project standard

Importing EPLAN parts (.edz) β€” EPLAN Data Portal

DXF import & export β€” two unrelated features, one format; command-line export and layers

Project files β€” .qetz (zipped, the default) and .qet, what is inside, opening big projects faster, starting from a template

The one-file project, .qetdb β€” history of saves, repair, --query over many projects

Saving safely β€” previous versions, a project open elsewhere, damaged files, crash recovery

The project database β€” the working SQLite database built when a project opens

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Code style β€” the QET house style for C++, and formatting only the lines you change

Fix or add with an AI assistant β€” beginner build setup and a prompt that does the work

Check your change: qet-verify β€” run it before every pull request

Posting with an AI assistant β€” short, plain pull requests and replies

Translate with an AI assistant β€” draft the interface in your language, check it, send it

Making a how-to video β€” a short feature video from a checked story

Writing wiki pages with an AI assistant β€” the rules, and a checker to run before you push

Automating QET β€” CLI, XML formats, external tools

CLI Reference β€” command line usage

JavaScript Scripting β€” --run, geometry editing, undo

MCP server β€” let an AI assistant read, verify and edit projects

Connecting an AI assistant β€” setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons β€” stored scripts with an icon, by hand or by an assistant

Live mode β€” an assistant working in the open project while you watch

Macro recorder β€” record a task by hand, for an assistant to script

Development Roadmap

Vision β€” proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally