2 Replies Latest reply on Jul 29, 2020 5:47 AM by Vasudevan TS

    How can I write the expression such that

    James Bond New Member
      I have this expression
      (IIF(LTRIM(RTRIM(SUBSTR(HEADER_INFO,2,13)))='',NULL,LTRIM(RTRIM(SUBSTR(HEADER_INFO,2,13))))) 

      for the sample data attached, but it is failing when it finds more than one D records after the H record.

      My goal is to have an expression that if it sees multiple D records after the H record, it reads those records as well, and if only one D record, it reads that record and move to the next H record.

      Right now, it is failing because it is expecting an H record after each D record, but there are situations as shown below where there are more than one D records after an H record.