List in project variables

Alexandre78
Alexandre78 Dataiku DSS Core Designer, Registered Posts: 1 ✭✭✭

Hello,

I would like to know if it is possible to create a list as a Project variable and to use the different items of this list later in a recipe. For example, if we want to filter a dataset and keep only the ID which are in the list we defined in the Project variables section.

Answers

  • Sarina
    Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 317 Dataiker

    Hi @Alexandre78
    ,

    You can indeed create JSON objects in project variables, including arrays. In order to interpret the variable as a list, you do need to either use the formula language or Python in order to interpret it as a list and not a string.

    Here's an example using the formula language to filter a column based on a list of values. Similar logic can be applied anywhere you can apply the formula language or in a Python recipe. Here's a list of order ids defined in project variables:

    projectvariables.png

    And how to use the array functions from the formula language to apply to the variable:

    LplRKEpiScfJa2ameVUWY1PvwvWRsmkDuA (1).png

    I hope that information is helpful. If you have any questions, feel free to attach some screenshots of your specific use case so that we can provide more specific context.

    Thanks,
    Sarina

Setup Info
    Tags
      Help me…