LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Converting empty string in unicode field to null

    Employee
    Posted 06-26-2014 02:31

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: aop

    Hi!

    I'm trying to replace an empty string to null but for some reason I don't get it to work. My field type is unicode so does that require something special from the syntax?


  • 2.  RE: Converting empty string in unicode field to null

    Employee
    Posted 06-26-2014 05:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ThomasT

    Maybe you should try:
    if 'field' == "" then X = null else X = 'field'
    emit * override emit X as "field"


  • 3.  RE: Converting empty string in unicode field to null

    Employee
    Posted 07-01-2014 12:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rhallmark

    You may also try to convert the field to string first before trying to change the empty field to null.

    X = if field.str().trim() == "" then str(null) else field.str()

    emit *
    override emit X as field