Community Conundrum 25:Feature Visualization is now live! Read More

Dynamic Global variables in DSS

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
Dataiker
Dataiker
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
Level 2
Author
Thanks! Can it be used in recipe like Group_by and Prepare?
0 Kudos
Dataiker
Dataiker
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)