Data360 Analyze

 View Only
  • 1.  Extract an existing characters from a string

    Employee
    Posted 07-13-2021 10:04

    Hi,

    I have been trying to extract a set of letters/digits from the a string. I was trying .left but it gives me error and i am using a transform node.  

    Kindly help me with this.


    if fields.issuer_rbcsic is Null:
    out1.issuer_rbcsic = "Null"
    else:
    out1.issuer_rbcsic = in1.issuer_rbcsic.left(2)

     



  • 2.  RE: Extract an existing characters from a string

    Employee
    Posted 07-14-2021 01:13

    The Python string slice syntax should be used instead of the legacy script's left() operator.

    See the 'Migrating from LAE' > 'What's changed?' > 'BRAINscript to Python' > 'String functions' topic in your system's Help documentation or the online documentation for the latest release here.

    Additional information is also available in the Python language documentation on handling strings