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.  Group by month/service

    Employee
    Posted 05-25-2017 17:47

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

    Originally posted by: dunkleym

    Hi all

    I have a list of services, bill dates and usage for each month. What I'm trying to do is output each bill month to a new colum, then Sum usage against each service.


    Service Bill Usage
    1 25/03/17 123
    1 25/02/17 456
    1 25/01/17 789
    2 25/03/17 213213
    3 25/03/17 1215
    4 25/03/17 46645
    4 25/02/17 546546

    is someone able please to sched some light on the best way to do this please?

    Thanks

    Matt


  • 2.  RE: Group by month/service

    Employee
    Posted 05-25-2017 17:59

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

    Originally posted by: dunkleym

    I've tried Agg/Ex node

    March = groupSum('Total Data')
    February = groupSum('Total Data')
    January = groupSum('Total Data')
    December = groupSum('Total Data')
    November = groupSum('Total Data')

    emit referencedFields(1,{{^GroupBy^}}), April
    , March
    , February
    , January
    , December
    , November

    where lastInGroup




    "Group by: 'servuce ID','Bill Date'


  • 3.  RE: Group by month/service

    Employee
    Posted 05-25-2017 19:19

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

    Originally posted by: stonysmith

    GroupByDate.brg
    The attached graph presents three different methods for performing the task.
    Hold your mouse over the title for each box for an explanation.

    Method 1 is closest to what you attempted.. Method 3 is my preferred way of doing it.

    The only things this doesn't cover well is if you have missing data for an entire month, or if you have more than 12 months to consider. Those features could be added.


  • 4.  RE: Group by month/service

    Employee
    Posted 05-25-2017 21:26

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

    Originally posted by: dunkleym

    Thanks

    they worked, option 1 requires a concat of rows. Option 3 fails on the last node saying 'March already exists'.

    Matt


  • 5.  RE: Group by month/service

    Employee
    Posted 05-25-2017 21:59

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

    Originally posted by: dunkleym

    removed 'Bill' off group by field