Data360 Analyze

 View Only
  • 1.  Group rows by every 7 rows and total the groups

    Posted 04-12-2023 14:11

    I want to separate the rows of data by every 7 rows.  Each row is a date, and that obviously changes every month. The reason I want to do this is to total every 7 days of the month and total the remaining days of the month after the first 4 sets of seven (besides February). I want the total line name to be the last date from the pull group. How can I separate each row by 7 and total each group?

    Date               Entity 1   Entity 2   Entity 3   Entity 4
    2/19/2023       $$              $$          $$          $$
    2/20/2023       $$              $$          $$          $$
    2/21/2023       $$              $$          $$          $$
    2/22/2023       $$              $$          $$          $$
    2/23/2023       $$              $$          $$          $$



    ------------------------------
    Trevor Jacobs
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Group rows by every 7 rows and total the groups

    Posted 04-13-2023 06:02

    Maybe something like this ?


    First assigning a Row id for each row(from a query or static data and then joining to your original set), and working with that type of logic in a transform node.
    This code will group values of 7 in the first 4 outputs, and the remainder in the 5th. After that you can use an aggregation node maybe.



    Br



    ------------------------------
    Henrik B
    E.ON Sverige
    ------------------------------



  • 3.  RE: Group rows by every 7 rows and total the groups

    Employee
    Posted 04-13-2023 11:25

    This might be helpful.  You could assign a week identifier to each record, by maybe finding the date of the end of the week, maybe the next Friday.  Or by identifying the Month by finding the first day of the month for each record.  I'm attaching a screenshot of this.

    DateOfFriday and Month would then be available to aggregate by.



    ------------------------------
    Ernest Jones
    Precisely Software Inc.
    PEARL RIVER NY
    ------------------------------



  • 4.  RE: Group rows by every 7 rows and total the groups

    Posted 04-17-2023 14:08

    Hey Ernest!  This worked perfectly!  Thank you for your help!!



    ------------------------------
    Trevor Jacobs
    Knowledge Community Shared Account
    ------------------------------