How To Use DESelect Segment
Step 2: Target Definition
Can I build an Aggregation Custom Value grouping on two fields?
https //support deselect com/hc/en us/articles/13315185655953 , we explained https //support deselect com/hc/en us/articles/13315185655953 now, let's take it one step further what if we want to create an aggregation based on multiple fields? as we saw https //support deselect com/hc/en us/articles/13315185655953 , the “for each…” section only allows you to select one field… let’s take a look at how it can be done! let’s take the example of counting the number of customers per gender and country to be able to select a combination of multiple fields to create an aggregation upon, we’d first need to combine those fields as a new one, so we can later use it when building the aggregation create a step1 selection with a custom value in the target definition that is using sql function concatentating country field with gender field formula concat("deselect demo customers" "country",' ',"deselect demo customers" "gender") as a result of this first step, we will have a custom value field added to the target de, which has a unique value field, combining the fields that we need to use for our aggregation create a step2 selection, in which the selection criteria is the target de of step1 in the target definition of step2 selection, and given our example “counting number of customers per gender and country” we need the following fields to be added to our target data extension country (from the selected de) gender (from the selected de) count custom value, in which we are going to create our aggregation, to count customers for each country and gender the result will be the sum of customerid in the deselect demo customers for each country gende r in step1 while we got the correct results in the preview, they are duplicated (one row per customerid , even though the customerid column is not shown ) so, one more step to remove the duplicates could be making both “country” and “country gender” a primary key finally, the result will be what we are looking for