Not (PQL)
Returns the logical reverse of a boolean input
- Returned Output: Boolean
- Library: PQL \ Granular \ Logical
- Version: 2023.00.000
- Compatibility: Pyramid Query Language (PQL) data sources
Syntax
Not( <Column Boolean> )
* Click on the function's arguments above for more details on the input values.
Comments
- The only argument can be a simple or complex logical statement made up of columns, values, other functions that return a boolean result (true or false).
- The function effectively switches the statement results from true to false and false to true.
- For details on how to employ and use this function see the custom column overview.
Different Function types
- As a granular function, it is used in the base SQL query itself.
Example
This example checks if the values in the price column are 20% higher than the values in the cost column. If they are NOT, it returns the word "profits", otherwise it returns the word "losses."
If( not( [transactions].[Price]>([transactions].[Cost]*1.2) ) , "profits" , "losses" )
You can see the effect from this example snippet in not column at position #5, based on the Price and Cost columns at positions #2 and #3. (It effectively does the opposite of the if column at position #4.)