Incremental query incremental-query
The Incremental query activity is a Targeting activity which allows you to query the database on a scheduled basis. Each time this activity is executed, the results from the previous executions are excluded. This allows you to target only new elements.
The Incremental query activity can be used for various types of uses:
- Segmenting individuals to define the target of a message, audience, etc.
- Exporting data. For example, you can use the activity to regularly export new logs in files. It can be useful if you want to use your log data in external reporting or BI tools.
The population already targeted by previous executions is stored in the workflow. This means that two workflows started from the same template do not share the same log. However, two tasks based on the same incremental query in the same workflow use the same log.
If the result of an incremental query is equal to 0 during one of its executions, the workflow is paused until the query’s next programmed execution. The transitions and activities that follow the incremental query are therefore not processed before the following execution.
Configure the Incremental query activity incremental-query-configuration
Follow these steps to configure the Incremental query activity:
-
Add an Incremental query activity into your workflow.
-
In the Audience section, choose the Targeting dimension then click Continue.
The targeting dimension lets you define the population targeted by the operation: recipients, contract beneficiaries, operator, subscribers, etc. By default, the target is selected from the recipients. Learn more about targeting dimensions
-
Use the query modeler to define your query, the same way you create an audience when designing a new email. Learn how to work with the query modeler
-
In the Processed data section, select the incremental mode to use:
-
Exclude results of previous execution: Each time the activity is executed, the results of the previous executions are excluded.
Records already targeted in previous executions can be logged a maximum number of days from the day they were targeted. To do this, use the History in days field. If this value is zero, the recipients are never purged from the log.
-
Use a date field: This option allows you to exclude results from previous executions based on a specific date field. To do this, choose the desired date field from the list of attributes available for the selected targeting dimension. On the next executions of the workflow, only data that has been modified or created after the last execution date will be retrieved.
After the first execution of the workflow, the Last execution date field becomes available. It specifies the date that will be used for the next execution, and is automatically updated every time the workflow is executed. You still have the possibility to override this value by manually entering a new one so that it fits your needs.
note note NOTE The Use a date field mode allows more flexibility depending on the date field that is selected. For example, if the specified field corresponds to a modification date, the date field mode will allow you to retrieve data that were recently updated, while the other mode will simply exclude recordings that were already targeted in a previous execution, even if they have been modified since the last execution of the workflow. -
Example incremental-query-example
The following example shows the configuration of a workflow which filters every week the profiles in the ÃÛ¶¹ÊÓƵ Campaign database that are subscribed to the Yoga Newsletter service, to send them a welcome email.
The workflow is made up of the following elements:
- A Scheduler activity, to execute the workflow every Monday at 6 am.
- An Incremental query activity, which targets all of the current subscribers during the first execution, then only the new subscribers of that week during the following executions.
- An Email delivery activity.