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 assigning based on date in a column

    Employee
    Posted 04-24-2014 18:39

    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 ,in one of the column values coming like
    Entry: Jacqueline Desjardins - 001 on 09/17/1997
    Entry: Jacqueline Desjardins - 002 on 02/05/1999
    Entry: Betty Liu - 001 on 03/07/1996
    Entry: Pedro Santiago - 001 on 09/17/1992
    Entry: Pedro Santiago - 002 on 04/09/1994
    Entry: Pedro Santiago - 003 on 10/29/1996
    Entry: Norman Chan - 001 on 05/09/1999
    Entry: Elsa Ramos Vasquez - 001 on 04/19/1994
    Entry: Nik Ra - 001 on 09/12/1997
    Entry: Nik Ra - 002 on 06/28/1999

    my requirement ,while loading the data,in other column i want to load sequence number based on date value
    Entry: Jacqueline Desjardins - 001 on 09/17/1997 001
    Entry: Jacqueline Desjardins - 002 on 02/05/1999 002
    Entry: Betty Liu - 001 on 03/07/1996 001
    Entry: Pedro Santiago - 001 on 09/17/1992 001
    Entry: Pedro Santiago - 002 on 04/09/1994 002
    Entry: Pedro Santiago - 003 on 10/29/1996 003
    Entry: Norman Chan - 001 on 05/09/1999 001
    Entry: Elsa Ramos Vasquez - 001 on 04/19/1994 001
    Entry: Nik Ra - 001 on 09/12/1997 001
    Entry: Nik Ra - 002 on 06/28/1999 002

    Please help me how can i achieve this.


  • 2.  RE: Sequence number assigning based on date in a column

    Employee
    Posted 04-25-2014 00:59

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

    Originally posted by: stonysmith

    If I understand your request properly, you could accomplish it this way:

    s = split(ColumnName,"-") #split at the dash
    t = s[1].trim().split(" ") #split on blanks
    Seq = t[0] #get first field after the dash
    emit ColumnName,Seq