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.  check within date range

    Employee
    Posted 03-26-2017 21:18

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

    Originally posted by: Buddha

    Hi All,

    I'm having trouble identifying where my orders are duplicating within a date range.

    I have a large set of data and I need to identify where the order created timestamp falls within another orders range on the same account
    eg the below the top 2 orders should be flagged as 'Impacted' but the 2nd 2 should not (larger data set attached)
    Account,Order,Order_CREATED,Expiry Date
    0034759041916,702069811606,2016-02-01 03:15:46,2016-03-02 23:59:59
    0034759041916,702170297161,2016-02-01 04:37:32,2016-03-02 23:59:59
    0044860041125,672955253971,2015-12-31 22:47:15,2016-01-30 23:59:59
    0044860041125,701110247206,2016-01-31 00:52:53,2016-03-01 23:59:59
    INC24380279-multiple TP orders list.txt

    I greatly appreciate your help on this

    Buddha


  • 2.  RE: check within date range

    Employee
    Posted 03-28-2017 06:28

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

    Originally posted by: gmullin

    Try something like this in a filter. It will show anything that has an Expired Date more than 30 days past the Order_Created date.

    dayRange = 30
    
    expDate = 'Expiry Date'.date("CCYY-MM-DD")
    expTime = 'Expiry Date'.right(9).trim().time("HH:MM:SS")
    
    expDateTime = timestamp(expDate, expTime)
    
    creDate = 'Order_CREATED'.date("CCYY-MM-DD")
    creTime = 'Order_CREATED'.right(9).trim().time("HH:MM:SS")
    
    creDateTime = timestamp(creDate, creTime)
    
    
    emit *, creDateTime as Created, expDateTime as Expired
    where expDateTime.dateSubtract(creDateTime) > dayRange