How to remove letters/chars preceding last '-' in a string

Aminmin
Aminmin Dataiku DSS Core Designer, Registered Posts: 18 ✭✭✭✭

Hi all, i have a column comprising of text of letters and characters followed by country name -> SC/K-UGANDA, SN/KG-AMERICA,TT-NG-PERU ......etc. I only want to populate the country name.

Please advise how i can do this using recipe in DataIKU or what step/code can i add.

Thank you for your kind attention and advice.

Regards

Aminmin


Operating system used: IOS

Tagged:

Best Answer

  • Jurre
    Jurre Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Registered, Dataiku DSS Developer, Neuron 2022 Posts: 114 ✭✭✭✭✭✭✭
    Answer ✓

    That's what i like about this application : options to discover thanks for the tip @Manuel

    another option would be splitting the column on '-'and truncating the outcome to the last occurance of that '-'. or the last two if '-'-containing countries is a concern.

    cheers!

Answers

  • Manuel
    Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭

    Hi,

    In a Prepare recipe, add a "Extract with Regular Expression" processor and then use the Smart Pattern Builder.

    //play.vidyard.com/5RLFrHK4dEPFwuV7BoV8kZ.html?

    I hope this helps.

  • Aminmin
    Aminmin Dataiku DSS Core Designer, Registered Posts: 18 ✭✭✭✭

    Hi Manuel, thanks for the tip. But i am not able to find the Smart Pattern Builder. Maybe mine is a lower version. However, really appreciate your kind advise as i now know the existence of this builder. Thank you and have a great weekend!

  • Aminmin
    Aminmin Dataiku DSS Core Designer, Registered Posts: 18 ✭✭✭✭

    Hi Jurre, greatly appreciate your prompt reply. Your solution works for me...Have a great weekend!!

Setup Info
    Tags
      Help me…