Tutorial | Dynamic recipe repeat#
The dynamic recipe repeat feature allows you to execute multiple runs of a recipe, iterating on a dataset to update parameters each time.
Get started#
Objectives#
In this tutorial, you will:
Create an Export to folder recipe.
Create a dataset that defines which data you will export.
Use the recipe repeat feature for the Export to folder recipe.
Prerequisites#
Dataiku 13.2 or later.
An advanced understanding and regular use of recipes, datasets, and folders.
Create the project#
To create the project:
From the Dataiku Design homepage, click + New Project > DSS tutorials > Advanced Designer > Dynamic Recipe Repeat.
From the project homepage, click Go to Flow (or
g
+f
).
Note
You can also download the starter project from this website and import it as a zip file.
Use case summary#
Let’s say you have a dataset that includes information about the most successful and famous Hollywood movies. You also want to export a report folder that breaks this dataset down into different CSV files per distributor. The report folder would contain a dataset for each distributor including every filtered film. In other words, it’s like dividing the dataset into smaller datasets per distributor.
The Flow is composed of:
The Highest_Hollywood_Grossing_Movies dataset which contains the data of the Hollywood movies including their title, distributor, release date, and genre, to name a few.
The Distinct_Distributors dataset which contains the list of each unique distributor.
Create the Export to folder recipe repeat#
First, we want to create the recipe that we wish to repeat.
Select the Highest_Hollywood_Grossing_Movies dataset.
In the Actions panel, in the menu of Other recipes, select the Export to folder recipe.
Under Name for the output, enter
Hollywood_Movies_Per_Distributor
.Click Create Folder to confirm.
Click Create Recipe.
Set the repeating settings#
Once the recipe is created, we can set the repeating parameters.
Navigate to the Advanced tab.
Select the Enable checkbox in the Repeating recipe panel.
From the Dataset dropdown, select the Distinct_Distributors dataset.
Click Save.
Note
Keep the default Mode. Thus, the distributor column is by default used as the distributor variable.
Set the repeating variable#
Here, we choose to iterate the recipe on each distributor. Now that we have the recipe repeat set up, we can use the iterator variable to accomplish our goal.
Switch back to the Settings tab.
Unselect the With header checkbox.
Toggle on the Filter.
Next to Keep only rows that satisfy, select a formula.
Enter the formula
Distributor == '${Distributor}'
. Each time the recipe repeats, the${Distributor}
variable will be the next distributor from the dataset we created.Enter
${Distributor}_FILM.csv
as the File name.Click Save.
Click Run.
The new folder will contain one CSV file per distributor listed in the prepared dataset.
What’s next?#
Congratulations! You’ve seen how to create, configure, and manipulate a recipe repeat in an Export to folder recipe making your Flow more dynamic.
Check out the Academy for other advanced features to master!