LAE

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

Discussions

Members

Resources

Events

 View Only
  • 1.  Sequence number generation

    Employee
    Posted 07-19-2014 04:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Hi Team,
    In my source one of the column values are like below,

    Account
    10000000
    10000000
    10000003
    10000007
    10000019
    10000024
    10000025
    10000025
    10000031
    My requirement is based on Account number,if one Account 2 times, for two rows should come same sequence number.
    Output should populate like this.

    Account Sequence number
    10000000 1
    10000000 1
    10000003 2
    10000007 3
    10000019 4
    10000024 5
    10000025 6
    10000025 6
    10000031 7
    Please help me how to generate based on Account number using Filter node.


  • 2.  RE: Sequence number generation

    Employee
    Posted 07-20-2014 15:17

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Assuming that Account is already sorted, then:
    -----------------------
    node:Filter
    bretype:core::Filter
    editor:sortkey=53cc3d81717f4a3f
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    if firstExec
    then {
    SeqNum = 1
    PrevAccount = Account
    }
    else if Account != PrevAccount
    then SeqNum = SeqNum + 1


    PrevAccount = Account

    emit *, SeqNum

    EOX
    editor:XY=290,150
    end:Filter
    -----------------------


  • 3.  RE: Sequence number generation

    Employee
    Posted 07-21-2014 07:42

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    I've been training myself to think about problems in a more "user friendly" way. You can actually add sequence numbers with minimal BRAIN-scripting. First remove duplicates. Add execCount as a sequence number. Then use Lookup to add the sequence number to the original data set. It takes longer, but may be easier to conceptualize.
    Attachments:
    SeqNumber.brg