6 Replies Latest reply: Feb 15, 2018 5:28 AM by Andrea Gigliotti RSS

    Replace specific cell IF

    Krzysztof Wroclawski

      Hi Experts,

       

      I have another issue with my app. The scenario seems to be complicated at least from a newbie perspective.

       

      Sample

       

      LOAD

       

      LineID,

      DocumentNo,

      EndDate,

      EndDate2,

      date(if(len(trim([EndDate]))=0, "EndDate2", "EndDate")) +1 as StartDate

       

      FROM [lib://app/forexperts.csv]

      (txt, utf8, embedded labels, delimiter is ',', msq)

       

      Above gives me the table like this:

      LineIDDocumentNoStartDateEndDateEndDate2
      1INVOICE10012018/1/12017/12/312017/12/31
      2INVOICE10012018/1/12017/12/312017/12/31
      3INVOICE10012018/1/12017/12/312017/12/31
      4INVOICE10012018/1/12017/12/31
      5INVOICE10012018/7/12018/6/30

       

      What I am trying to do is to replace 2018/7/1 with 2018/1/1 if LineID=5 and DocumentNo=INVOICE1001.

       

      Do you have any ideas?

      Thanks