--- title: "QQ - How do I use Conditional and IF statements in DataJet?" slug: "qq-how-do-i-use-conditional-and-if-statements-in-datajet" updated: 2022-11-22T10:21:37Z published: 2022-11-22T10:21:37Z canonical: "docs.datajet.app/qq-how-do-i-use-conditional-and-if-statements-in-datajet" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # QQ - How do I use Conditional and IF statements in DataJet? There are 4 mechanisms for working with Conditional Statements in DataJet: 1. **Engineering | Functions | FLogic** functions 2. **Engineering | Functions | LMath** 3. **Engineering | Expression Field | Conditional** functions 4. **Script | Editor | IF ELSE ENDIF** Methods ### FLogic FLogic functions are designed to rapidly evaluate conditional functions on large volumes of data, and are an efficient way of executing logical processing. They are accessed from the Engineering | Functions menu: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1669037098188.png) Selecting an FLogic function will bring up the Engineering Function Dialog: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1669037187020.png) These functions are analagous to IF statements. The logic of these functions can be thought of as follows: - If(A=B, 1, 0) - If A = B, then 1, Else 0 The output of an FLogic function is a new dataset. For more information, see [FLogic Overview](/v1/docs/flogic-overview) ### LMath Functions Conditional selection of either C or D, based on value of A and B ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1669112345674.png) These functions are analagous to IF statements.  The logic of these functions can be thought of as follows: - If(A>B, C, D) - If A > B, then C, Else D ### Expression Field Engineering | Expression Field will open the Expression Field dialog which offers various conditional functions, including: - between (value, lower, upper) - if (cond, tval, fval) - ifs(cond, value, cond, value, final) - isnull (x) ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1669037437471.png) ### IF ELSE ENDIF Script Editor supports conditional processing for the IF ELSE ENDIF method. Find this on the **Script Editor | Tools** menu ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1669037676031.png) ```json [ { "method": "IF", "condition": "%StartRow%==0 && %EndRow%==0", "project": "project" }, { "method": "ELSE", "project": "project" }, { "method": "ENDIF", "project": "project" } ] ``` IF "condition" can be "true" or "false" (and hence form a conditional execution, especially useful with [DEFINES](/v1/docs/defines), also known as variables). For more information on IF ELSE ENDIF, see [IF ELSE ENDIF](/v1/docs/if-else-endif)