Dips > Data Processing > Query Data

# Creating an Expression

The first step in creating a query, is to create an Expression. As you can see at the top of the Query Data dialog, an Expression consists of Data, Operator and Operand.

For example, the following are valid Expressions:

TYPE == joint

SPACING < 1.5

Set != 2

Data

The Data drop-down list will always contain:

- the names of the columns of the current file, in order of appearance in the spreadsheet, followed by

- the Processed Orientation data (i.e. Processed Trend, Processed Plunge etc.)

Note: The user CANNOT type in the Data box, an item must be selected from the list. This prevents errors due to incorrect typing.

Operator

The Operator drop-down list will always contain the following operators:

- == (equals)

- != (not equals)

- < (less than)

- <= (less than or equals)

- > (greater than)

- >= (greater than or equals)

- Includes (find data containing a given substring)

Note that the behaviour of the < , <= , > and >= Operators depends on the nature of the Operand. If the Operand is numeric, then the comparison will be numeric. If the Operand is a text string, then a string comparison will be performed.

Note: The user CANNOT type in the Operator box, an operator must be selected from the list. This prevents errors due to incorrect typing.

Operand

The Operand drop-down list will contain a sorted list of the data in the Data column you have selected (i.e. the Data box at the left of the Expression). Note that the sorting of the Operand list is based on a string comparison, therefore numeric Data will not necessarily be listed in numeric order (i.e. the numbers 2, 3, 200 would be listed in the order 2, 200, 3).

The Operand drop-down serves two purposes:

1. It shows the user the contents of a selected Data column.

2. It allows the user to select from the list with the mouse.

However, unlike the Data and Operator boxes, the user CAN TYPE in the Operand box. This allows the user to type in specific numeric values, or to type in substrings to be searched for by the Includes Operator, for example.