7 Replies Latest reply: Jan 22, 2017 8:36 PM by Sunny Talwar RSS

    Challenging: Conditionally split string

    John-Harald Holmlund

      I need to split this string on each $A where interval between following $A-date is more than 60 days?

      How would I achieve this?

       

      RecordId, String

      RecordIdOriginalString
      1000A01.07.2015 00:00:00|$S07.07.2015 00:00:00|$B07.07.2015 00:00:00|$A10.07.2015$CK16.07.2015 00:00:00|$O16.07.2015 00:00:00|$A12.10.2015 00:00:00|$S12.10.2015 00:00:00|$CI16.10.2015 00:00:00|$A19.07.2016 00:00:00|$S20.07.2016 00:00:00|$B04.08.2016 00:00:00|$CI23.08.2016 00:00:00

       

       

      Wanted output:

      RecordIdSplitString
      1000_1A01.07.2015 00:00:00|$S07.07.2015 00:00:00|$B07.07.2015 00:00:00|$A10.07.2015$CK16.07.2015 00:00:00|$O16.07.2015 00:00:00
      1000_2$A12.10.2015 00:00:00|$S12.10.2015 00:00:00|$CI16.10.2015 00:00:00
      1000_3$A19.07.2016 00:00:00|$S20.07.2016 00:00:00|$B04.08.2016 00:00:00|$CI23.08.2016 00:00:00

       

      Can't use subfield as it would split into 4 rows, not taking my condition into consideration.