Demo Data Package
Demo Data Package Scenarios
13. Get the Order Line with the highest Quantity for each Product (basic deduplication)
note the scenario below uses data from the deselect demo data package see docid 5 cozdtg0nwmlmeufrmbz scenario products are ordered many times (stored in order lines) you want to pick the order line with the highest quantity for each product, so you can see the biggest quantity of each product that has been ordered in note this scenario uses the feature basic deduplication, which is available in deselect plus 1\ input on the selections overview screen, click on create new to create a new selection drag data extension deselect demo order lines to the selected data extensions section 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 products with the highest quantity order line, and press save select the following fields by either double clicking on them or dragging them to the section on the right orderid and quantity from deselect demo orderlines name 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 name as the unique field (this is the product name) press next choose prio deduplication mode basic as the field that determines the priority, choose quantity under prioritization logic, choose sort all values choose highest under value for quantity deselect will now give priority to the record with the highest value for quantity for each product name 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 orderid and quantity from deselect demo orderlines name from deselect demo products the results table shows only one orderline per product, the one with the highest quantity for that product