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

How to replicate groupString macro in the new python-based Transform or Aggregate nodes

Comments

5 comments

  • Avatar
    Gerry Mullin

    You can't use the group sum feature in ProcessRecords, it belongs in ConfigureFields. In an Aggregate node and select Sum and your field from the drop down menu in Operations, then change the view from Grid to Advanced you'll see something like this in ConfigureFields:

    outputs[0]["Total"] = group.sum(fields["Price"])
    0
    Comment actions Permalink
  • Avatar
    Daniel Rempel

    Thanks Gerry. I'm not talking about groupSum but groupString. This macro would take all the string values in a field for the group being aggregated and concatenate them into a single string field for the output record.

    0
    Comment actions Permalink
  • Avatar
    Gerry Mullin

    I'm sorry, I completely misread it! Here's how you do you group string with a pipe delimiter:

    out1.GroupStringField = group.joinStrings(in1.FieldName,False,'|','')
    0
    Comment actions Permalink
  • Avatar
    Daniel Rempel

    Thanks Gerry. And that would also be done in the ConfigureFields node of an Aggregate node?

    Is there somewhere some more in-depth documentation that I'm missing? Where would one find this stuff by the old "RTFM" method?

    0
    Comment actions Permalink
  • Avatar
    Gerry Mullin

    Yes, in the ConfigureFields, exact same as group sum. This link has more information on it.

    0
    Comment actions Permalink

Please sign in to leave a comment.