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.  Exploding date range into a record set of dates

    Employee
    Posted 11-20-2014 03:51

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

    Originally posted by: khopkins

    Hi Everyone,

    I am trying to get Lavastorm to create a set of date records from a single set of from and to dates and i am wondering how to do this.

    for example i have a node that retrieves todays and a date 13 months previous to this date using brainscript

    ftomDtm=(dateAdjust(date(),-13,"months"))
    toDtm = date()
    This then gives me the two dates fromDate(2013-10-20) and toDtm(2014-11-20)

    I then want to use these two dates to export every single date inbetween that range and i am stuck on getting it to work and help help would be appreciated.


    Regards,

    Keith


  • 2.  RE: Exploding date range into a record set of dates

    Employee
    Posted 11-20-2014 04:11

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

    Originally posted by: andycooper

    Hi Keith,

    The attached graph takes a start and end date and uses this to produce a list of all date values within that range.

    If you need any more info please let me know.

    Thanks

    Andy

    ExtractDates.brg


  • 3.  RE: Exploding date range into a record set of dates

    Employee
    Posted 11-20-2014 04:24

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

    Originally posted by: khopkins

    Hi Andy,

    Thanks for that but do you have that graph with the input data as a static node so i can see how it works as i have no access to the spreadsheet in the graph?

    Regards,

    Keith


  • 4.  RE: Exploding date range into a record set of dates

    Employee
    Posted 11-20-2014 04:45

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

    Originally posted by: andycooper

    Keith,

    I did try to create a static data node but my date formats got messed up by Excel.

    This is the data I'm using: -

    Customer Number:int Booking Number:int Arrival Date:date Departure Date:date
    1 10001 01/08/2014 10/08/2014
    2 10002 01/08/2014 10/08/2014
    3 10003 01/08/2014 10/08/2014
    4 10004 01/08/2014 10/08/2014
    5 10005 01/08/2014 10/08/2014
    6 10006 01/08/2014 10/08/2014
    7 10007 01/08/2014 10/08/2014
    8 10008 01/08/2014 10/08/2014
    9 10009 01/08/2014 10/08/2014
    10 10010 01/08/2014 10/08/2014
    11 10011 01/08/2014 10/08/2014
    12 10012 01/08/2014 10/08/2014
    13 10013 01/08/2014 10/08/2014
    14 10014 01/08/2014 10/08/2014
    15 10015 01/08/2014 10/08/2014
    16 10016 01/08/2014 10/08/2014
    17 10017 01/08/2014 10/08/2014
    18 10018 01/08/2014 10/08/2014
    19 10019 01/08/2014 10/08/2014
    20 10020 01/08/2014 10/08/2014


  • 5.  RE: Exploding date range into a record set of dates

    Employee
    Posted 11-20-2014 05:47

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

    Originally posted by: khopkins

    Thanks Andy,

    I have it sorted now i was missing the output declaration and the do inside of the while comand which was causing my issue.

    Many thanks for the help.

    Keith