Using `with` control structure yields "unknown token" error

pillsy
pillsy Partner, Registered Posts: 5 Partner
edited July 16 in Using Dataiku

When I make any use of the `with` control structure in a Dataiku formula in a Prepare recipe, I get an error message complaining that the variable name is an unknown token. For example, if I use the formula example from the documentation:

with("european union".split(" "), a, a.length())

Dataiku complains "Formula is invalid : it has some unknown tokens" and highlights both instances of the variable `a` in red.

What am I doing wrong? Thanks!

Tagged:

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,925 Neuron

    Is "a" the name of your column? My test column was called Folder. Works for my column when using v10.0.7.

    Capture.PNG

  • pillsy
    pillsy Partner, Registered Posts: 5 Partner

    Wait, you can only bind the expression to an existing column name...?

    I'm not sure what the value of the construct is in that case.

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,925 Neuron

    No, but you copied pasted a formula using a sample column name. What exactly are you trying to achieve? Describe your requirement.

Setup Info
    Tags
      Help me…