Data360 Analyze

 View Only
  • 1.  Transform node to agg and count group data

    Employee
    Posted 06-17-2021 16:13

    I am trying to understand how to run the Aggregate functionality in the transform node so instead of having multiple aggregate nodes I can have the functionality in 1 transform node. 

    The input is 

    color:string, type:string, name:unicode, overdue:boolean

    Red, primary, Peter, true

    Green, primary, Peter, true

    Blue, primary, Fred, False

    Red, secondary, Jane, true

    I would like the output to be

    Color  Red    2

    Color  Blue   1

    Color Green  1

    Type primary  3

    Type secondary 1

    Name   Peter  2

    Name    Fred   1

    Name   Jane 1

    Overdue  true   3

    Overdue   false 1

    I have for example tried group.count(fields["color"])  to get the color values grouped and output but it just outputs

    1

    2

    3

    4



  • 2.  RE: Transform node to agg and count group data

    Employee
    Posted 06-21-2021 07:33

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

    Hi Don, the most simple way I can think to get to your final output would be to pivot your data first, then count it. That means I would use Pivot - Names to Data, followed by an Aggregate. An example is attached here, hope it helps!

     

    Attached files

    Pivot FieldNames.lna

     



  • 3.  RE: Transform node to agg and count group data

    Employee
    Posted 06-22-2021 05:52

    As Gerry says, pivoting the data will allow you to group the different measures as this cannot be performed in the Transform node.

    However, attached are some examples of using the grouping functions in the Transform node.

     

     

    Attached files

    Transform_Node_GroupCount - 22 Jun 2021.lna

     



  • 4.  RE: Transform node to agg and count group data

    Employee
    Posted 06-23-2021 12:59

    Gerry and Adrian.  Thank you very much! Works great! Pivoting the data and using the Agg node simplifies things a lot because in reality I have a table with 255 columns and I can get the unique values for all columns with minimal coding. The transform node examples are perfect also and reminded me to look at the Optional dropdowns because I wasn't using the GroupBy option. I was trying to do it all in the ProcessRecords section.

     

    Thank you again!!!