Demo Data Package
Demo Data Package Scenarios
15. Get the preferred Order Line based on complex rules (advanced deduplication)
note the scenario below uses data from the deselect demo data package see docid 5 cozdtg0nwmlmeufrmbz scenario a customer can have multiple order lines you want to get one order line per customer, and you want to pick the order lines for products in the following order \ any product in the jackets product family if there is an order line for this product \ product huawei p20 lite if there is an order line for this product and no order line for products in the jackets product family note this scenario uses feature advanced deduplication, which is available in deselect advanced 1\ input on the selections overview screen, click on new to create a new selection drag data extension deselect demo orders to the selected data extensions section drag data extension deselect demo order lines to the selected data extensions section and drop it on top of deselect demo orders create the relation orders field id deselect demo orders with matching deselect demo order lines order lines field orderid drag data extension deselect demo products to the selected data extensions section and drop it on top of deselect demo order lines create the relation order lines field productid deselect demo orderlines with matching deselect demo products products field id if we would run the selection like this, we would get all order lines however, we're only interested in one filter line per product the one with the highest quantity we'll add prio deduplication rules in step 2 2\ output hit the create data extension button, enter a name, eg orders with preferred products, and press save select the following fields by either double clicking on them or dragging them to the section on the right contactid from deselect demo orders orderid from deselect demo orderlines name, product family from deselect demo products click save data extension now, let's add the prio deduplication rules click on the settings icon on the upper right corner of the target data extension screen, and choose prio deduplication enable the use deduplication switch set contactid as the unique field (this is the product name) press next choose prio deduplication mode advanced click on add rule first rule drag product family from the available fields section to the filters section choose equals as the criteria enter jackets as the value hit save > we've now created our first rule click on add rule second rule drag name from the available fields section to the filters section choose equals as the criteria enter huawei p20 lite as the value hit save > we've now created our second rule deselect will now give priority to the records product family jackets , followed by records with product name huawei p20 lite if there are no order lines matching any of our defined rules for a specific customer (contactid), a random order line will be chosen press confirm to save your prio deduplication settings 3\ preview when you click run preview on the preview screen, a results table will be shown with fields contactid from deselect demo orders orderid from deselect demo orderlines name, product family from deselect demo products the results table shows only one orderline per contactid, with the preferred products if available