Examples

This topic describes the examples of planning engine queries.
  1. Query to filter Products resources for a specific attribute value:
    Operation Field Comparison Value Description
    ADD Products.Item Type = IP Add resources to the query results, from class Products, which have value IP for attribute Item type.
    The result of this query is the resources from Products class for which the value of Item type attribute is IP.
  2. Query to filter Products At Locations resources from which a specific property value exists in the first bucket:
    Operation Field Comparison Value Description
    LIMIT bucket.start = $bucket_start[0] Filter buckets with a start date of the first bucket in the calendar.
    ADD Products At Locations.qty on hand = %nil Add resources to the results, from the Products At Locations class, which contain empty value for qty on hand property in the filtered buckets above.
    The result of this query is the resources from Products At Locations class, where the qty on hand property is nil for the first bucket.
  3. Query for Customer Allocations resources which contain a property value between two values:
    Operation Field Comparison Value Description
    ADD Customer Allocations.external demand > 0 Adds resources to the results, from Customer Allocations class which contain a value greater than 0 for the external demand property for any bucket.
    LIMIT Customer Allocations.external demand < 0.01 Filter resources in the results above, which contain a value for external demand property less than 0.01 for any bucket.
    The result of this query is the resources from customer Allocation class, where the external demand property is between 0 and 0.01, for any bucket in the planning horizon.
  4. Query to filter Products At Locations resources which contain either of two properties with specific values:
    Operation Field Comparison Value Description
    ADD Products At Locations.qty on hand = %nil Add resources to the results, from Products At Locations class, which contain an empty value for qty on hand property for any bucket.
    ADD Products At Locations.qty on hand wip = %nil Add resources to the results, from Products At Locations class, which contain an empty value for qty on hand wip property for any bucket.
    The result of this query is the resources from Products At Locations where qty on hand property is nil, OR qty on hand wip property is nil.