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 Date, week

    Employee
    Posted 09-07-2017 22:01

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

    Originally posted by: Borg_species5618

    Hello All,

    tried to do a search but not successfull.

    here is my inout data (See attchimage for a better look

    Pic1.JPG
    Cal_Year Week_NBR_C PDD
    2016 2 6/01/2016
    2016 2 7/01/2016
    2016 2 8/01/2016
    2017 2 9/01/2017
    2017 2 11/01/2017
    2017 2 12/01/2017
    2017 2 13/01/2017
    2017 2 14/01/2017
    2017 3 15/01/2017
    2017 3 16/01/2017
    2017 3 17/01/2017
    2017 3 18/01/2017


    I want to group By Cal_Year and Week Number and show the Min Day and Max Day from each Group

    so here is a pic of what I am looking for
    Cal_Year Week_NBR_C Min PDD Max PDD
    2016 2 06/01/2016 8/01/2016
    2017 2 09/01/2017 14/01/2017
    2017 3 15/01/2017 18/01/2017
    pic2.JPG

    Pleae see attachments for better picures

    Thankou
    Frank


  • 2.  RE: Group By Date, week

    Employee
    Posted 09-07-2017 22:12

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

    Originally posted by: stonysmith

    Use AggEx

    SortInput=True
    GroupBy=Cal_Year,Week_NBR_C

    l=groupMin(PDD)
    h=groupMax(PDD)
    emit referencedFields(1,{{^GroupBy^}})
    where lastInGroup
    emit l as Min_PDD
    emit h as Max_PDD