4 Replies Latest reply: Jun 20, 2014 2:16 PM by Saurabh Wadhwa RSS

    Need help splitting a field using the first delimiter from the right.

      I've been using the script below to split a field into two:

       

      If(Index(AccountTemp,' ')=0,Null(),SubField(AccountTemp,' ',1))                      AS Account,

      If(Index(AccountTemp,' ')=0,AccountTemp,SubField(AccountTemp,' ',2))          AS AccountGroup,

       

      which works for:

       

      Denver Admin ---> Denver,      Admin,

       

      But doesn't work for:

       

      Washington DC Admin ------->               Washington,                DC,               Admin,

       

      Is there a way to split a field using the first space in the data from the right?