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.  Lookup to Prior Date Value

    Employee
    Posted 05-07-2015 08:25

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

    Originally posted by: mgp

    I have a list of customers and invoice dates. I need to pull in a beginning and end date for each row to perform a calculation. Please see the attached file for an example.

    For the Beg date, when the invoice date is populated, the beginning date = the invoice date. When the invoice date is null, it has to look ahead to the next invoice.

    For the End date, it needs to look up the prior invoice. If a prior invoice can't be found, then it should result in NULL.

    Thank you for any help!

    Capture.jpg


  • 2.  RE: Lookup to Prior Date Value

    Employee
    Posted 05-07-2015 19:34

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

    Originally posted by: ryeh

    Hi, Marisa! The easiest way is to break this into two steps. Looking back is straight-forward because we can just store the previous Invoice Date in a temporary prevInv variable. Looking ahead is not. So to do so, we can re-sort the date and play the same trick. See if the attached makes sense.
    Attachments:
    lookupPriorDate.brg