Derive – Flag
Deriving a field as a flag is similar to deriving a field as a formula except that the expression you create will ultimately result in one of two categorical values. One of the most common methods of deriving a field as a flag is to identify whether something of interest has occurred (for example, purchasing a product, visiting a website, and so on). In this example, we will take the Stock_numbers
field and collapse it into those people who have an investment and those that do not:
- Place a
Derive
node onto the canvas. - Connect the
Stock_numbers
node to the newDerive
node. - Edit the new
Derive
node. - Type
Investment
in theDerive field
textbox. - Click
Flag
on theDerive as
drop-down list. - Click the
Expression Builder
button. - Double-click on
Stock_numbers
in theFields
list box. - Click the greater than (
>
) button. - Type
0
.
- Click
OK
:
![](https://static.packt-cdn.com/products/9781788291118/graphics/cd0c07f8-f031-4823-925e-879ec6d6fb2d.png)
This equation is saying that if someone has a value greater than zero on the field Stock_numbers
, the Investment
field will be assigned the value T
, otherwise...