Logical Operators

Logical operators are designed to perform a conjunctive operation between 2 expressions, resolving to true or false values.

Syntax & Usage

expression 1 <operator> expression 2
Different Operator types
  • The operators are
    • AND: && in PQL or 'AND' in MDX
    • OR: || in PQL or 'OR' in MDX
  • The expressions used can be data points, numeric values, or model columns, depending on the calculation engine used and the context.

Examples

This example checks if the cost of blade products is less than or equal to 100,000 AND if sales are greater than 20,000 in the Semantic engine:

([Product].[Product].[Blade], [measures].[cost]) <= 100000 && [measures].[sales] > 20000

This example checks if the value of the product column is equal to Bikes OR if the value in the color column is equal to Blue in the Granular engine:

[Product] = "Bikes" || [Color] = "Blue"