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.  Matching Dates

    Employee
    Posted 05-04-2010 15:20

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

    Originally posted by: Iain Sanders

    Hi Guys,

    I'm running the following BRAINScript in a filter node:

    if ICPStartDate == date(2010-03-31) then result = '31/03/2010' else
    if ICPStartDate > date(2010-03-31) then result = '31/03/2010' else
    if ReportMonth < 200804 then result = '1/04/2007' else
    if ReportMonth < 200904 then result = '1/04/2008' else
    result = '1/04/2009'
    override emit *, result as "TariffResult"

    but if you look at e.g. row 44, "TariffResult" selects the wrong value: it selects a vale from '1/04/2009' instead of '31/03/2010', even if ICPStartDate is 2010-03-31

    Please advise why the following isn't working from above:

    if ICPStartDate == date(2010-03-31) then result = '31/03/2010' else

    BRD table attached.

    Thanks,

    Iain


  • 2.  RE: Matching Dates

    Employee
    Posted 05-04-2010 16:44

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

    Originally posted by: stonysmith

    The expression date(2010-03-31) is the wrong syntax.
    Use date(2010,03,31) instead.

    You are effectively saying:
    A=2010-03-31 # A= 01976
    result = date(A) # generates a day in 1905


  • 3.  RE: Matching Dates

    Employee
    Posted 05-04-2010 20:58

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

    Originally posted by: Iain Sanders

    Thanks - that's great!