We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

Use Agg Ex inside Do-while loop

Comments

2 comments

  • Avatar
    Adrian Williams

    Hi Toan,

    you don't need to use a looping construct to determine the account start and end dates.

    In the example attached after importing the data from the Excel file the START_DATE and END_DATE fields are converted from Unicode type to Date type in a Filter node. The data is then sorted by Account ID, Contract ID and START_DATE.

    Within the Agg Ex node, the START_DATE and END_DATE are stored for the first record in each group (where the group is denoted by the Account ID). The logic then compares the END_DATE for each record in the group with the stored end date and, if the current END_DATE is after the stored end date, the stored end date is updated. The account date information is output when all records in the group have been processed.

     

     

    Attached files

    Calculate_Account_Duration--share.brg

     

    1
    Comment actions Permalink
  • Avatar
    Toan Nguyen

    Thank you so much Adrian!

     

    Toan

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.