Prepare recipe

Registered Posts: 41 ✭✭✭✭

Hello, just wanted to know if this data transformation is possible out of the box.
text label text label

abc ['A', 'B'] => abc ['A', 'B']

def C def ['C']

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,253 Dataiker
    Answer ✓

    Hi @RohitRanga
    ,

    So you only need to handle the single string e.g convert C to ['C'] if it already starts with [ then do nothing.

    First thing that comes to mind would be using a formula :

    if(startsWith(new_column, "['"),new_column, concat("['",new_column,"']"))

    Let me know if that works for you.

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.