Data360 Analyze

 View Only
  • 1.  Comparing Fields Between Rows

    Posted 10-12-2022 12:10
    Hello everyone,

    This is probably elementary, but I'm losing the last of my hair. I'm new to Data360 Analyze and cannot for the life of me figure out how to reference data between records. I have a field with Submit Date (datetime) and a handful of records. What I need to do is create a new output that looks at the Submit Date from record 1, and compare to record 2. 2 to 3. 3 to 4. So on and so forth. Coding wise, I understand how to make this happen (I think) except for one very simple thing: I don't know how to reference record 1, 2, 3, so on and so forth in my code. It's easy as pie to compare data in a record, but I have no idea how to do between records. 

    Any help would be greatly appreciated.

    ------------------------------
    Daniel Pisani
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Comparing Fields Between Rows
    Best Answer

    Employee
    Posted 10-13-2022 06:45
    You can use the built-in node.firstExec variable in a Transform node to check if the node is processing the first record or a subsequent record and then run the appropriate part of an if statement.

    Given the following input data:

    The Transform node Python code would be:

    Which would result in the following output:

    Regards,
    Adrian

    ------------------------------
    Adrian Williams
    Precisely Software Inc.
    Naperville IL
    ------------------------------



  • 3.  RE: Comparing Fields Between Rows

    Posted 10-13-2022 12:51
    You are a wizard. Thank you a million.

    ------------------------------
    Daniel Pisani
    Knowledge Community Shared Account
    ------------------------------