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.  Populate TotalRecord Count As a New Field

    Employee
    Posted 01-14-2016 08:47

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

    Originally posted by: jpstory

    Hi

    I am trying to populate the total record count into the output as a additional column, but had no clue how to do that, any help will be appreciated, thanks.

    For example I have 10 records in the input, without doing anything I want to populate the total ( which is 10 here) at the end of my data as a new field, how can I do that?


  • 2.  RE: Populate TotalRecord Count As a New Field

    Employee
    Posted 01-14-2016 09:40

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

    Originally posted by: stonysmith

    Run the data thru an AGG node with this code:

    c=count()
    emit c as Records
    where lastInGroup
    set your GroupBy parameter to a constant value such as "1"

    ====
    then, take that output and use a Lookup node with this code:

    emit 1:*
    emit 2:Records as Records
    set both of the match keys again to a constant value such as "1"


  • 3.  RE: Populate TotalRecord Count As a New Field

    Employee
    Posted 01-14-2016 11:28

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

    Originally posted by: jpstory

    Works perfectly, Thanks!