The **Expression Builder** is a
general purpose tool that helps you construct WEAP's expressions
by dragging and dropping the functions and WEAP Branches into an editing
box. To access the wizard, either right-click on the data table or click
on the down arrow on the right side of the expression box, and choose
Expression Builder from the menu.

The screen of the Expression Builder is divided into two resizable panes. At the top are a set of tabs that are used to access the names of the mathematical, logical and modeling functions built-in to WEAP, as well as to access the names of all branches in WEAP. At the bottom of the screen is an editing box, into which you can directly type to edit an expression, or into which you can add an item from the top pane, either by dragging-and-dropping or by double-clicking on an item. At the right of the editing box is a set of buttons that give quick access to the most common mathematical operators (+, -, *, /, ^, etc.).

A toolbar at the top of the expression builder gives quick access to
the most common editing options such as **Cut**
(), **Copy** (), **Paste** (), etc. When constructing an expression, you can check whether
the expression is valid by clicking on the **Verify
**button. Finally, when you have finished with the expression, click
on **Finish** to put the expression
back into the data entry table you came from, or click on **Cancel**
to abandon the edit.

There are two tabbed pages in the Expression Builder:

**Functions**contain the list of functions built in to WEAP. You can see a list of ALL functions or filter the list to show the modeling, mathematical and logical functions. On the right of the tab, each function is fully documented with notes describing syntax and usage, as well as examples of how to apply each function. The modeling functions are the main functions used for defining and calculating variables in WEAP. The mathematical functions are standard mathematical functions (log, exp, max, min, etc.). Wherever possible the names and syntax of these functions are the same as equivalent functions in Microsoft Excel. The logical functions are standard logical operators (IF, AND, NOT, OR, LessThan, etc.) used to construct conditional expressions that yield different results depending on the values of variables.**Branches**contain a tree outline listing all WEAP branches. When you drag and drop a branch to add it to the expression, a pop-up box will appear prompting you to pick a variable from the branch to which you wish to refer. Data variables are listed first, followed by result variables (which all include "(calculated result from previous timestep)" after the result variable's name).

**See also:**
Data View, Expressions,
Examples of Expressions,
Export to Excel, Functions,
Import from Excel