Step 2: Assemble data sources
The Optimization Engine turns the ingested objects, KPIs, and calculated attributes that you defined in Step 1, into the data sources that you’re about to configure. Data sources are tables of PQL columns with the correct inputs for a parameter. The optimization model uses these inputs to make the calculations for the decision variables.
For each data source in your optimization model, you’ll need to tell the Optimization Engine:
What columns the data source includes. Each column can be an attribute of an object type, or a KPI or calculated attribute.
What filters are applied to the data source to filter to the records you need for your use case. You can use filters that are defined in the Knowledge Model you’re using, or add filters in the optimization model.
Objects must all be in the perspective and data model that you defined in Step 1. The attributes that you’re using from an object type don’t have to be placed in the same data source as each other.
Check if you have any categories of objects that do not make sense for the use case, and exclude them from the input data for the optimization model. For example, if the optimization model is for moving materials between plants, you should exclude a material that is only used at one plant. You can filter the objects at this stage by including PQL filters in your data sources. Alternatively, if you don’t need those objects for other apps and use cases, you can filter them out in the transformations for your object types so they don’t make it into the data model.
KPIs and calculated attributes must all be in the Knowledge Model that you defined in Step 1. As for objects, make sure that records that do not make sense for the use case are excluded from the input data for the optimization model. You can do this by including filters in your data sources.
If you’re using several KPIs or calculated attributes, it’s a good idea to create a validation view where you replicate the inputs from your Knowledge Model as tables for testing. For further validation, you can activate debug mode (see Step 3) and name the data sources you would like to check in more detail. The Optimization Engine will then write them as tables to the referenced data pool on the next run.
Here’s how to define data sources in the Optimization Engine UI:
Go to the Data Sources section of the Optimization Engine page.
Click Add Data sources to add a new data source.
Leave the dataset type as “PQL_COLUMNS”. This is the only available type.
Click Add Filters to add a new filter. Name the filter, and enter a PQL filter query in the editor window.
Click Add Columns to add a new column. Name the column and enter a PQL statement in the editor window.
Tip
If you’re using the same column in multiple data sources, it’s a best practice to keep the column names consistent across the data sources.
All of the PQL statements in a data source must resolve successfully within the data source. However, you can create multiple data sources that wouldn’t work together as a data model.
You can edit a data source by clicking the pen icon next to its name, or delete it by clicking the trash icon. To rename or delete a filter or column, click the context menu (the three vertical dots) in its row.
Next step: Step 3: Enable debug mode (optional)