4 Replies Latest reply: Oct 1, 2014 6:08 AM by Peterjohn Griffiths RSS

    Conditional load. If Condition Concatinate Load

    Peterjohn Griffiths

      Hi all,

      I have been trying to get this to work for ages and can't seem to work it out.

      I have a CSV file with dates in it in the format DD/MM/YYYY.

      I load the file and I then want to concatenate a new row with todays date, but only if it does not already exist.

      This is what I am working with to figure this out.

       

      UNQUALIFY *;

      History:

      LOAD * INLINE [

          History.Date

          27/09/2014

      ]
      ;



      DateRange:

      Load max(History.Date)as DateRange.UpperDate

      Resident History;



      //Only load todays data if it doesn't already exist.

      if (num(today()-DateRange.UpperDate) > 0) then

      Concatenate(History)

      LOAD * INLINE [

      History.Date

      '30/09.2014'

      ]
      ;

      end if