Create if, then, else statements

Sv3n-Sk4
Sv3n-Sk4 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 32 ✭✭✭✭

Hello everyone,


Sorry to bother you but I am looking everywhere and can't find the Create if, then, else statements.

I would like to create a formule with the help of the creator that we can see here but I am not able to find where to get it.

Create if, then, else statements — Dataiku DSS 11.0 documentation

Thanks a lot for the help.

Tagged:

Answers

  • JordanB
    JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 296 Dataiker

    Hi @Sv3n-Sk4
    ,

    Processors can be found in Prepare recipes. In a prepare recipe, select "+add a new step" and search for the processor (as shown below). Please let us know if you have any questions.

    Screen Shot 2022-10-18 at 1.43.47 PM.png

    Thanks!

    Jordan

  • Sv3n-Sk4
    Sv3n-Sk4 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 32 ✭✭✭✭

    Hey @JordanB
    ,

    Thanks a lot for you quick answer!

    I was looking where I should but unfortunately it seems my version (from where I work) hasn't got this processor....

    Thanks anyway

  • JordanB
    JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 296 Dataiker

    @Sv3n-Sk4

    No problem! And, so you're aware, this processor was released in DSS version 11.

    Best,
    Jordan

  • Sv3n-Sk4
    Sv3n-Sk4 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 32 ✭✭✭✭

    That's where the problem was.

    I just learned we only still are at the 9.0 version.

    I will try to find a way to create my if else statement!

    Thanks a lot!

  • JordanB
    JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 296 Dataiker

    Hi @Sv3n-Sk4
    ,

    You can create an if/else statement with a formula processor in a prepare recipe. The statement could go something like this:

    if(customer_id == col1, col2, col3) which resolves to if condition (customer_id) equals col1 then execute col2, else execute col3

    Please let me know if you have any questions.

    Thanks!
    Jordan

  • yesitsmeoffical
    yesitsmeoffical Registered Posts: 15

    is it possible to reorder the "then" logic with multiple entries?

    for example:

    IF A == 1,

    THEN

    C == 3

    D == 4

    B == 2

    is there an easy way to place B in front of C and D without rewriting the entire thing?

  • tgb417
    tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,598 Neuron

    @yesitsmeoffical
    ,

    Just a hint in case it helps you. This is an advanced technique.

    When I find the user interface does not allow me to reorder parts of steps in visual recipes. I will often copy the recipient step out of DSS in the usual way. Which put the step on my computers clipboard. Then rather than immediately pasting the step back into the visual recipient. I’ll paste it into an IDE like visual studio that supports JSON formatting. I’ll then manually edit the recipient step in visual studio, copy the step out of visual studio and paste it back into Dataiku DSS in the usual way. This has many times saved me from a lot of extra effort when it comes to working with visual recipes.

    Note: there is no documentation for these JSON snipits. And the support team is not likely to provide support if you run into problems. That said for many of the visual steps the JSON is fairly intuitive.

    good luck. Also if you are running into a problem with the UI you can also add a product idea to the forums.

Setup Info
    Tags
      Help me…