Dynamic Global variables in DSS

Highlighted
ele_f
Level 2
Dynamic Global variables in DSS
Hi,

I wanted to ask if in DSS it is possible to define some global variables at workflow level that can be called in different recipes in different points in the flow.

For example, set @SomeVariable = 'VALUE' and then use SomeVariable in the flow in my recipe.

It would be an extremely useful feature! E.g. If I wanted to run the workflow first for product = Y and then product = X, I could define a product variable. Or if I wanted to run my flow for timestamp < DATE I could define the variable DATE = %mydate% and change this as I like.

Thanks!
0 Kudos
3 Replies
Clément_Stenac Dataiker
Dataiker
Re: Dynamic Global variables in DSS
Hi,

This is possible. It's usable mostly in code recipes, and also in formulas in visual recipes;

Please see https://doc.dataiku.com/dss/latest/advanced/variables_expansion.html
0 Kudos
ele_f
Level 2
Re: Dynamic Global variables in DSS
Thanks! Can it be used in recipe like Group_by and Prepare?
0 Kudos
Alex_Combessie Dataiker
Dataiker
Re: Dynamic Global variables in DSS
Prepare recipe: yes using a Formula processor and the "${variable_name}" syntax (make sure to put " quotes around the ${}).
Group recipe: yes using Formulas in Prefilter / Computed Columns / Postfilter if you run the recipe with the DSS or Spark engine. For SQL engine, you may want to convert the recipe to SQL and then do your variable manipulation there.
0 Kudos
Labels (2)