Handbook

Read values from a table in a rule

By the end, a rule reads the wheelbase from a Library table according to the number of wheels.

What you need

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

Steps

  1. Open Library → Tables.
  2. 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.

  3. 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.

  4. 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.

  5. In the Rules step, click the parameter.

    In the configurator, click rozvor in the tree. The editor opens in the Properties panel.

  6. 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.

  7. Open Evaluation → Values.

    The rule's result is "800".

  8. Save the configurator.

    Click the save icon in the window header or press Ctrl+S.

Import a table from Excel

A table from Excel is a copy. gull system never writes to your file.

  1. In Library → Tables, click Import from Excel.

    Choose an .xlsx, .xlsm or .csv file.

  2. Pick the Sheet.

    A .csv file does not have this choice.

  3. Adjust the Name.

    It starts as the file's name. Rules read the table under this name.

  4. 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.

Overview

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

Check that it worked

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.

Common problems

What's next

Back to the handbook