By the end, a rule reads the wheelbase from a Library table according to the number of wheels.
rozvor on the part *Trubka pro kola*.Počet kol with a default of 2. Use your own names and data.A Library table holds data, such as a size range or a price list. Every rule reads it by its name. The example uses the table Nápravy:
| Počet kol | Rozvor | Nosnost |
|---|---|---|
| 1 | 0 | 750 |
| 2 | 800 | 1500 |
| 3 | 1600 | 2700 |
Click New table.
The button is on the ribbon. While there are no tables, the row Create a new table does the same. A grid opens like Excel's, with a single empty cell, A1.
Fill in the table.
Type the column names in row 1 and the data under them. The next empty column and row appear by themselves as you type. Paste a block from Excel with Ctrl+V.
Save the table.
Click the save icon in the window header or press Ctrl+S. In the Name and save window, type Nápravy and confirm with Save.
In the Rules step, click the parameter.
In the configurator, click rozvor in the tree. The editor opens in the Properties panel.
Type the lookup.
Type VLOOKUP([Počet kol], [Nápravy], 2, FALSE). The Tables menu inserts the table's name. The function finds the number of wheels in the first column and returns the value from column 2. FALSE means an exact match.
Open Evaluation → Values.
The rule's result is "800".
Save the configurator.
Click the save icon in the window header or press Ctrl+S.
A table from Excel is a copy. gull system never writes to your file.
In Library → Tables, click Import from Excel.
Choose an .xlsx, .xlsm or .csv file.
Pick the Sheet.
A .csv file does not have this choice.
Adjust the Name.
It starts as the file's name. Rules read the table under this name.
Click Import.
The table joins the list and is read-only. Double-click to open it. Change the data in the file and bring it into gull system with Reload.
Columns count from 1. The results are for the table Nápravy.
| Function | What it does | Example and result |
|---|---|---|
VLOOKUP(value, table, column, match) |
searches the first column, returns the value from the given column | VLOOKUP(2, [Nápravy], 3, FALSE) = 1500 |
HLOOKUP(value, table, row, match) |
searches the row of names, returns the value from the given row; row 1 is the names | HLOOKUP("Rozvor", [Nápravy], 3, FALSE) = 800 |
TABLECOLUMNLOOKUP(value, lookup column, result column, not found, mode, direction) |
searches any column; the last three arguments are optional, the mode is "EXACT", "NEAREST", "NEAREST_SMALLER" or "NEAREST_LARGER" |
TABLECOLUMNLOOKUP(2000, TABLESELECTCOLUMNS([Nápravy], 3), TABLESELECTCOLUMNS([Nápravy], 1), "-", "NEAREST_LARGER") = 3 |
TABLEGETVALUE(table, column, row) |
the value at a position; column and row are optional, row 1 is the first row under the names | TABLEGETVALUE([Nápravy], 2, 2) = 800 |
GETTABLEVALUE(table, row, column) |
the same with the row first | GETTABLEVALUE([Nápravy], 2, 3) = 1500 |
TABLEGETCOLUMNINDEXBYNAME(table, name) |
a column's number from its name | TABLEGETCOLUMNINDEXBYNAME([Nápravy], "Nosnost") = 3 |
TABLEGETROWCOUNT(table) |
the number of rows, names included | TABLEGETROWCOUNT([Nápravy]) = 4 |
TABLEGETCOLUMNCOUNT(table) |
the number of columns | TABLEGETCOLUMNCOUNT([Nápravy]) = 3 |
TABLESELECTCOLUMNS(table, column, …) |
a new table with only the chosen columns | TABLESELECTCOLUMNS([Nápravy], 3) |
TABLEFILTER(table, column, condition) |
a new table with only the rows that meet the condition | TABLEGETVALUE(TABLEFILTER([Nápravy], 3, ">=1500"), 1, 1) = 2 |
LISTALL(table, column) |
every value in a column, as a list | LISTALL([Nápravy], 1) = 1|2|3 |
LISTALLDISTINCT(table, column) |
the same without repeats, for a field's choices | LISTALLDISTINCT([Nápravy], 1) = 1|2|3 |
LISTALLCONDITIONAL(table, column, condition column, condition, …) |
values from the rows that meet every condition; LISTALLCONDITIONALDISTINCT is the same without repeats |
LISTALLCONDITIONAL([Nápravy], 1, 3, ">=1500") = 2|3 |
The rule's result is 800. In the Define inputs step, change the default of Počet kol to 3 and the result is 1600. Then put 2 back.
VLOOKUP returns #VALUE!.
The value is not in the table. Text is compared regardless of case, but spaces are not trimmed. The fourth argument is required. Guard a missing value: IFERROR(VLOOKUP(…), "").
VLOOKUP with TRUE returns a different row than Excel.
TRUE finds the nearest value in either direction and the table need not be sorted: for 2.4 it finds 2 wheels and for 5 it finds 3. If you want only the next value up or down, use TABLECOLUMNLOOKUP with the mode "NEAREST_LARGER" or "NEAREST_SMALLER".
A condition on a table result comes out wrong.
A lookup returns text, and text is compared with a number as text: VLOOKUP([Počet kol], [Nápravy], 2, FALSE) > 1000 is true for 800. Convert it to a number: VALUE(VLOOKUP([Počet kol], [Nápravy], 2, FALSE)) > 1000.
The result is #REF!.
The column or row number is outside the table.
TABLEGETVALUE reads one row off.
The grid numbers rows like Excel, so the names are on row 1. In a rule, row 1 is the first row under the names, which is row 2 in the grid. HLOOKUP does count the row of names.
The table cannot be saved.
Two columns have the same name, or a column with data has none. Rules could not tell which column you mean. Fix the names in row 1.
A table from Excel cannot be edited.
A table imported from Excel is changed in the file: edit it and click Reload. To edit it in gull system, click Detach from file in the Properties panel; the rows stay. Pick another file or sheet with Browse… on the Source row.
The table says The sheet has changed since it was imported.
The file holds newer data. Rules read the last imported copy until you click Reload.
The table says The file was not found.
The file was moved or renamed. The table keeps its last copy. Pick the new location with Browse….
A rule says an input and a table share a name.
Rules read inputs, variables and tables by the same name. Rename one of them.
A script does not see the table.
In Code mode, Library tables are not available. If you need a table, stay in Formulas mode.
A field's choices from a table column: LISTALLDISTINCT([Nápravy], 1).
Create variables and constants
Read a table value in one place.
Use functions and conditions in a rule
Handling a missing value, and other functions.
Colours, textures and materials for rules.