Get record column1 that is not Null and output in Column2

Comments

3 comments

  • Avatar
    Adrian Williams

    You could use the following code in a Transform node (it assumes your input field and output field are both string data types as per your screenshot and defaults to using 1st January 1900 if the first record has a Null value):

     

    #### ConfigureFields property script

    out1 += in1
    out1.test = str

     

    #### ProcessRecords property script

    if node.firstExec:
      previousValue = '1900-01-01'

    if fields.Column1 is not Null:
      out1.test = fields.Column1
      previousValue = fields.Column1
    else:
      out1.test = previousValue

     

    0
    Comment actions Permalink
  • Avatar
    Dino111

    Hi Adrian, 

    thanks, I had already seen the firstExec node but could not get it to work (could not find enough information and the online documentation gives a timeout). 

    Thanks again
     
    Dino
    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    Hi Dino,

    The second sample code snippet in the ProcessRecords script of the Transform node includes an example of using the node.Exec() method.

    I believe there was an issue with the link to the online version of the desktop edition help for a short while that has been resolved. The online help documentation is for the server also covers the Python scripting topics and is available here.

    Regards,

    Adrian

    0
    Comment actions Permalink

Please sign in to leave a comment.



Powered by Zendesk