Results 1 to 3 of 3

Thread: WORKDAY() Excel function in Lavastorm

  1. #1

    Default WORKDAY() Excel function in Lavastorm

    Hi!

    I'm trying to replicate the WORKDAY() formula from Excel, which returns a date that is a given number of working days ahead of or prior to the start date.

    For example WORKDAY ('Start Date', 60) would return a Date 60 working days after the selected 'Start Date'.

    Is there a way to do the same in Lavastorm??

    Thanks a lot!
    Best,
    Maria

  2. #2
    Lavastorm Employee
    Join Date
    Nov 2012
    Location
    Warrington, UK
    Posts
    244

    Default

    Hi Maria,

    The dateAdjust() function does not take into consideration whether the adjustment period includes weekends so you would need to account for these days when determining the actual number of days to increment/decrement the start date by.

    Here is one way you could do this. It is relatively fast for smaller adjustments/number of records. However, due to the iterative nature of the adjustment mechanism used, there may be better ways of achieving this if there is a large adjustment period and/or many input records.

    Adjust_by_Workdays--share.brg


    Btw, there is an in-built node that calculates the converse - the number of working days between two dates (i.e. equivalent of the Excel networkday() or networkday.intl() functions); this is the Calculate Workdays node in the Profiling and Patterns category.

    Regards,
    Adrian
    Last edited by awilliams1024; 05-20-2019 at 08:31 AM. Reason: Corrected workday() to networkday()

  3. #3

    Default

    Thanks a lot Adrian!

    It works perfectly for now!
    Hope it will continue to work for larger data sets as I'm currently working on a small sample, but in the meantime I'll keep your solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •