Add a Derived column
The derived column is used to automatically copy a value from another table. You can use it in two ways:
1) The derived column load a value from an external table based on the value selected in a Dropdown column in the same table.
Example: given two tables Customer and Orders. In every new order you want to add in addition to Customer Name also the Address, City and Telephone.
- Create the Customers and Orders tables.
- Add Name, Address, City, and Phone columns to the Customers table.
- Create a Dropdown column in Orders table called Customer that takes data from the Name column of the Customer table.
- Add a Derivated column in the Orders table.
- Enter Address in column name.
- In Derivated column settings choose, under "Column to use as a reference," the Customer column.
- Under "Column in the external table from which to take the value" choose Address column.
- Repeat steps 4, 5, 6 and 7 for other Derivated columns City and Telephone.
2) The Derived column load a value from an external table by "Created by" column (this is a system column).
Example: we have a table "Orders" in which the sales agents enter new orders. For every new entry you want automatically add the Fees associated with each agent.
- Create an Agents and Orders tables.
- Add a Name column to the Agents table.
- Add a numeric column called Fees.
- Enter data in the Agents table. In the Name column you must be entered user names used by agents registered in BaseBear. You can view the username on the Share page of a database.
- In Orders table add Order No., Description, Date columns.
- Add in Orders table a Derived column called Fees.
- Set Agents table in "External table from which to take the value".
- Set Name in "column in the table to use as a reference to".
- Set Fees in "column in the external table from which to take the value".
- Now for every new order the Fees of the Agent added automatically. The value source is the Agents table.