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.  Some records values not reading

    Employee
    Posted 06-13-2014 08:53

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

    Originally posted by: sree

    Hi Team,

    My source is xlxs file.In this file all records,all value are reading/coming till final filter node.

    In final filter node, i used following logic for the date field.

    recno=count()
    if 'ORIGINAL HIRE DATE'.str() == " " then X = 'LAST HIRE DATE'.date("CCYY-MM-DD") else X = 'ORIGINAL HIRE DATE'
    Month=date(X, "CCYY-MM-DD").month().str().pad(2)
    Date=date(X, "CCYY-MM-DD").day().str().pad(2)
    Year=date(X, "CCYY-MM-DD").year()
    EffectDate = Date +"/"+Month +"/" + Year
    emit
    " " as fields,
    recno as Rownum,
    EffectDate as "Effective Date",
    "Position_ID" as "Position_Reference_type",
    Attached screen shot for sample input data,Expected output, present output coming screen shot

    Date issue.JPG


    But in some records in EffectDate value place BLANK coming.
    please help me what i need to change logic or where is the problem.

    Thanks in advance.

    Regards,
    Sree.


  • 2.  RE: Some records values not reading

    Employee
    Posted 06-13-2014 22:43

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

    Originally posted by: andycooper

    Sree,

    Am I reading your script correctly that you have a space in between the two quotes? If so then won't this look for cells that have a space rather than blanks? Have you tried to run the node removing the space or using ISNULL?

    I tried ISNULL in a simple example and that worked on my data.

    Andy


  • 3.  RE: Some records values not reading

    Employee
    Posted 06-20-2014 09:01

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

    Originally posted by: rhallmark

    I would try this:

    if ('ORIGINAL HIRE DATE'.str().trim() == "" or 'ORIGINAL HIRE DATE'.str().isNull()) then X = 'LAST HIRE DATE'.date("CCYY-MM-DD") else X = 'ORIGINAL HIRE DATE'