Easy Insight Logo
Call 1-(720)-316-8174

Conditional Logic

case a case statement, also known as a switch statement, is used for conditional logic. A case or switch statement allows for selection control in order to allow the value of a variable or expression to change the control of flow of a program's execution via a conditional statement or multiway branch.

case([Field], "x", 1, "y", 2, 3)

would return 1 if Field is x, return 2 if Field is y, and 3 if anything else.

if

if for conditional logic

if([Field1] > [Field2], 1, 0)

will return 1 if the value of Field1 is greater than the value of Field2

if([Field1] >= [Field2], 1, 0)

will return 1 if the value of Field1 is greater than or equal to the value of Field2

if([Field1] == [Field2], 1, 0)

will return 1 if the value of Field1 is equal to the value of Field2

if([Field1] <= [Field2], 1, 0)

will return 1 if the value of Field1 is less than or equal to the value of Field2

if([Field1] < [Field2], 1, 0)

will return 1 if the value of Field1 is less than the value of Field2

if([Field1] != [Field2], 1, 0)

will return 1 if the value of Field1 is not equal to the value of Field2

if(([Field1] > [Field2]) && ([Field3] > [Field4]), 1, 0)

will return 1 if the value of Field1 is greater than the value of Field2 AND the value of Field3 is greater than the value of Field4

will return 1 if the value of Field1 is not equal to the value of Field2

if(([Field1] > [Field2]) || ([Field3] > [Field4]), 1, 0)

will return 1 if the value of Field1 is greater than the value of Field2 OR the value of Field3 is greater than the value of Field4

RESOURCES
Twitter Logo