Data360 Analyze

 View Only
  • 1.  Transform Node

    Employee
    Posted 12-04-2021 11:00

    How to use DateTime with/in if else condition within Transform node for comparison. Is there possible way to do the same.

    eg. if in1.fieldDateTime > 2010-01-01T12:00:00+05:30

    As you can see in eg i want those records whose value is greater than this.



  • 2.  RE: Transform Node

    Employee
    Posted 12-07-2021 09:30

    You can use the following approach:

    In the ConfigureFields script, a function is defined to parse the timezone-aware datetime string to a datetime type object.

    The reference datetime string is then parsed.

    The output metadata are defined for an outpuut field to hold the reference date and the comparison results.

    Then in the ProcessRecords script the variables are assigned to the output fields. The compare_result field uses the greater than comparison from the built-in 'null safe' functions module.

    If you only want to output the records where the comparison is True you can modify the logic in the ProcessRecords script. See the attached example.

     

    Attached files

    Transform_Node_Compare_TZ_Aware_Dates - 7 Dec 2021.lna