Skip to main content

Predicate Basics

Predicates are conditions placed in the where clause of a source query. The query engine evaluates predicates to determine which entities from Siemens Polarion ALM are included in the sheet. Simple predicates compare a property value to a target; composite predicates combine multiple conditions with AND/OR logic.

Step 1: Use Equality Predicates

The simplest predicate matches a property to an exact value:
sources:
  - id: main
    model: rtm-model
    query:
      from: UserNeed
      where:
        severity: critical
This returns only UserNeed entities where severity equals critical. For explicit equality syntax:
where:
  severity:
    eq: critical

Step 2: Use Comparison Operators

The following comparison operators are available for filtering:
OperatorMeaningExample
eqEqualsseverity: { eq: critical }
neNot equalsstatus: { ne: deleted }
gtGreater thanpriority: { gt: 3 }
geGreater than or equalpriority: { ge: 2 }
containsSubstring matchtitle: { contains: safety }
where:
  priority:
    gt: 3
The gt and ge operators work with numeric properties (integer, float). They are not applicable to string or boolean properties.

Step 3: Check for Null Values

To filter entities based on whether a property has a value:
# Entities where title IS NOT null (has a value)
where:
  title:
    ne: null

# Entities where title IS null (missing value)
where:
  title:
    eq: null
Null checks are useful for finding incomplete work items or ensuring required fields are populated.

Step 4: Combine Predicates with AND

Use the and operator to require all conditions to match:
where:
  and:
    - severity: critical
    - status: approved
This returns entities that are both critical severity AND approved status. AND arrays support any number of sub-predicates:
where:
  and:
    - severity: critical
    - status: approved
    - priority:
        ge: 2

Step 5: Combine Predicates with OR

Use the or operator when any condition should match:
where:
  or:
    - severity: critical
    - severity: major
This returns entities where severity is either critical OR major.

Step 6: Nest Composite Predicates

AND and OR predicates can be nested for complex filtering logic:
where:
  and:
    - status: approved
    - or:
        - severity: critical
        - severity: major
This returns approved entities with either critical or major severity. diagram

Step 7: Use NOT Predicates

Negate any predicate with the not wrapper:
where:
  not:
    status: deleted
Simple predicates (equality, null checks) are converted to efficient Polarion Lucene queries. Complex predicates (nested OR, NOT with composite conditions) may be evaluated in-memory after fetching, which can impact performance on large datasets. Keep predicates simple when possible. See Optimize Queries.

Verification

After updating the where clause in your sheet configuration and reloading the document:
  1. You should now see only entities that match your predicate conditions
  2. The row count in the sheet should reflect the filtered result set
  3. Verify that excluded entities are not displayed in the sheet

See Also

Source Code
  • Query.java
  • QueryExecutorTest.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/__tests__/odata-where-merger.test.ts
  • QueryToLuceneTest.java
  • PolarionQueryProcessor.java