Data360 Analyze

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

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  running number of a flow

    Employee
    Posted 04-18-2017 06:57

    How do I create a running number of a data flow (similar to auto increment of database)?

    Every time the data flow run, the number should be increased by a constant (i.e. 1), and will be emitted as one of the output columns.

    Thanks.



  • 2.  RE: running number of a flow

    Employee
    Posted 04-18-2017 14:17

    use this:

    emit execCount as myRowNumber

    or this:

    if firstExec then myRowNumber=0
    myRowNumber = myRowNumber +1

    emit myRowNumber


  • 3.  RE: running number of a flow

    Employee
    Posted 04-18-2017 17:59

    Thank you. What if I want the number to be persistent per run not per row.

    For example, for initial run

    run_id, name, amount

    1, susan, 1000

    1, peter, 200

    1, Samie, 300

    Next time when the data flow is executed

    2, susan, 1212

    2, peter, 234

    2, Samie, 334



  • 4.  RE: running number of a flow

    Employee
    Posted 04-19-2017 03:54

    There are probably some more elegant ways to achieve this but... the attached .lna file contains a node that stores a persistent execution count in the specified file. If the file does not exist it is created and the execution count starts at 1.

    Obviously, you must use a unique file for each data flow that would use a persistent execution counter.

    Regards,

    Adrian

     

    Attached files

    Persistent_Exec_Count.lna



  • 5.  RE: running number of a flow

    Employee
    Posted 04-19-2017 09:18

    Another possible way to do this is to use the date (and time) as a unique identifier