"where" brainscript functionality in Python

Comments

3 comments

  • Avatar
    Stony Smith

    You simply use an IF statement to control the output:

    Make sure that you nest ALL output references under that IF statement.

    if myCondition:
           out1 += in1 
           out1['myField'] = somevalue

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    You will also need to ensure that the condition also handles Null values.

    There are some other examples of filtering shown in the default ProcessRecords script displayed when the Transform node is added to the canvas. Also see the examples shown in the Transform node online help, which show the effect of setting the output record to None and the use of the implicit write mode.


    You may also be interested in the Migrating to Dataverse guide which covers scripting and other differences between Dataverse and the Lavastorm LAE product:


    https://installers.lavastorm.com/Dataverse320/Migrating+to+Dataverse.pdf


    In addition, a useful way understanding the Python code is to look at the automatically generated code in the Advanced tab of the Filter node once some filter criteria have been specified using the filter grid editor.

     

    Regards,

    Adrian

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    The is also a Dataverse Python module some 'Null safe' functions available for comparisons and string manipulation, see the help in this topic:  Python scripting > Python module support

    The topic is also available online here:

    https://d3sa-preview.infogixsaas.com/docs/dist/help/Default.htm#f-script/python/python-modules.htm

     

    0
    Comment actions Permalink

Please sign in to leave a comment.



Powered by Zendesk