Prepare recipe

RohitRanga
RohitRanga 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']

Tagged:

Best Answer

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,215 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

Setup Info
    Tags
      Help me…